Re: [PHP] How to detect the host (window or Linux)?
On Mon, Sep 22, 2008 at 4:04 PM, Thodoris <[EMAIL PROTECTED]> wrote: > >> $win = stripos(PHP_OS, 'win') !== false ? true : false; > Perhaps you could also use this as an alternative: > > http://gr.php.net/manual/en/function.php-uname.php Thanks Thodoris and Anderson. Sorry for not clear about the question. I mean to detect the OS in Host system where the browser is located, not the SERVER OS. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: Browser could not get mp3 files from http site
On Wed, Sep 24, 2008 at 9:56 AM, Richard Lynch <[EMAIL PROTECTED]> wrote: > As a general rule, check what happens when you do wget -S on the URL and see > what the browser sees. Thanks Richard and all responses. That was the best PHP and HTML debug I've learned so far. I always find it is difficult to debug html and JS when doing PHP program. I can debug C/C++ using gdb well but no idea what the tools can be used for browser debug. Anyway, the problem has been resolved. It turns out it was an authorisation issue. My web server requests a log in at beggin, although I can see every pages and download other data and image files, somehow it cannot download the mp3 file. As soon as I remove the login, it works fine. Appreciate all of your helps and responses. Cheers. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: Browser could not get mp3 files from http site
On Wed, Sep 24, 2008 at 1:03 AM, Nathan Rixham <[EMAIL PROTECTED]> wrote: > Ashley Sheridan wrote: >> >> On Tue, 2008-09-23 at 21:23 +1000, hce wrote: >>> >>> Hi Ashley, >>> >>> The object tag is indeed working. It does not automatically play >>> audio.mp3 from my home web server, but it does automatically play if I >>> add an audio source value from a streaming server. Can you make it >>> work to play the audio automatically from a normal web server not >>> streaming server? >>> >>> Thanks. >>> >> As far as I'm aware it should play from any server. What kind of paths >> are you putting into the object tag? Absolute or relative and is it a >> URL or local resource? >> >> >> Ash >> www.ashleysheridan.co.uk >> > > > when the file isn't in a streaming server you have buffering to contend > with; odds are it won't play the file till it's completely downloaded > [regardless of autoplay/autostart] I am not sure if it is a buffering problem or not. I am baffled as I can play from opening a file file:///home/webserver/audio.html, but could not play it if I play from an URL http::/www.myweb.com/audio.php, the audio.php generate the same content of the audio.html. > A few questions: > Why don't you just link to the audio.mp3 file and let the users browser/pc > determine how best to play it [normal]? I am sure you have many ways to play an mp3 file, that was not what I was asking for. My intention is to learn and understand the PHP and HTML program, and to resolve problems. It bothers me as I could not unserstand why the URL way does not work as it should. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: Browser could not get mp3 files from http site
On Wed, Sep 24, 2008 at 12:53 AM, Ashley Sheridan <[EMAIL PROTECTED]> wrote: > On Tue, 2008-09-23 at 21:23 +1000, hce wrote: >> Hi Ashley, >> >> The object tag is indeed working. It does not automatically play >> audio.mp3 from my home web server, but it does automatically play if I >> add an audio source value from a streaming server. Can you make it >> work to play the audio automatically from a normal web server not >> streaming server? >> >> Thanks. >> > As far as I'm aware it should play from any server. What kind of paths > are you putting into the object tag? Absolute or relative and is it a > URL or local resource? I tried both relative and absolute paths as following from a firefox browser: Or http://www.myweb.com/audio.mp3";> The audio.mp3 is in the same location with audio.php. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: Browser could not get mp3 files from http site
Hi Ashley, The object tag is indeed working. It does not automatically play audio.mp3 from my home web server, but it does automatically play if I add an audio source value from a streaming server. Can you make it work to play the audio automatically from a normal web server not streaming server? Thanks. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: Browser could not get mp3 files from http site
On Sat, Sep 20, 2008 at 1:29 PM, Michelle Konzack <[EMAIL PROTECTED]> wrote: > Am 2008-09-12 18:14:23, schrieb hce: >> Hi, >> >> I have a php file audio.php to send mp3 file audio.mp3 to browsers, >> the browser needs following html code to play mp3 file. I thought it >> should work if I put the the audio.mp3 file in the same localtion with >> the http://www.myweb.com/audio.php. But the browser could not get the >> audio.mp3. I guess something is missing here, please correct me. >> >> > Hey, what are you blubbering here? > It is: > > Are you sure you can make following my original code work to play the mp3 automatically in firefox or any other browsers? BTW, I also tried to change http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] How to detect the host (window or Linux)?
Hi, How can I detect the host is window or linux in PHP code? Thank you. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Browser could not get mp3 files from http site
Thanks Dan and Ash. I've tried object tag, it crashed my firefox. The audio.php file generates a simple following html. You need media player plugin to test it. The web server http://www.myweb.com/audio.php is my home server. Let me further discribe the problems, it is not the embed tag problem, it is the source in the embed tag does not download to the browser (In fact, I've tried the object tag as Ash suggested, the object tag crashed firefox): (1) If I open following audio.html directly from "Open File" file:///home/webserver/audio.html, the embed tag works just fine, the audio can play. The /home/webserver is the directory where all applications audio.php and audio.mp3 are stored. (2) If I open from http://www.myweb.com/audio.php, the audio.mp3 does not download to firefox. Nothing is played. Thanks. Jim On 9/13/08, Ashley Sheridan <[EMAIL PROTECTED]> wrote: > As far as I'm aware, the embed tag is not supported in any HTML > standard, and as such, it's a little hit and miss. Depending on what you > want to achieve, you should look towards the object tag instead: > > http://joliclic.free.fr/html/object-tag/en/ > > > > Ash > www.ashleysheridan.co.uk > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Browser could not get mp3 files from http site
Hi, I have a php file audio.php to send mp3 file audio.mp3 to browsers, the browser needs following html code to play mp3 file. I thought it should work if I put the the audio.mp3 file in the same localtion with the http://www.myweb.com/audio.php. But the browser could not get the audio.mp3. I guess something is missing here, please correct me. Thank you. Jim -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Does PHP support utf16 encode / decode
On Mon, Jun 16, 2008 at 3:59 PM, Chris <[EMAIL PROTECTED]> wrote: > hce wrote: >> Hi, >> >> I know PHP supports utf8 encode/decode, but does it support utf16 >> encode/decode? If yes, would you please point me a php manual URL? > > It's listed as supported under the mbstring functions here: > > http://www.php.net/manual/en/mbstring.supported-encodings.php Thanks Chris for the link, PHP has utf8_encode and utf8_decode. Does PHP provide utf16_encode and utf16_decode, or the mbstring has different functions to encode and decode utf16? Thank you. Jim -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Does PHP support utf16 encode / decode
Hi, I know PHP supports utf8 encode/decode, but does it support utf16 encode/decode? If yes, would you please point me a php manual URL? Thank you. Jim -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] PHP connection to external application
On 6/14/08, Per Jessen <[EMAIL PROTECTED]> wrote: > hce wrote: > > > Anyway, thanks for all your responses and suggestions. It was good > > suggestion to use SOAP and Web services, but we have very small > > latency requirement, I have already worried about the delay in the > > lower level of socket, it will be evern more processing delays for > > useing SOAP and Web services. > > > Agree - it's only extra overhead. > > Jim, if I were you, I'd go for the socket-communication, i.e. TCP. That > setup is being used for all kinds of stuff - unless your latency > requirements are extreme, I think TCP will be fine. Thanks Per. Yes, I'll indeed use the socket connection which will be the minimum process delays and overheads I can get. In option 2 you responsed: > System V message queues are intended for just that; IPC = Inter Process > Communication. The delays and overheads in message queue (in my option 2) may be smaller than the socket, but I guess that might require the external C server to be compiled with the PHP module as they are totally seperated. Thank you. Kind Regards. Jim -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] PHP time out for socket_recvfrom or socket_read block call
Hi, How can use time out mechanism in PHP when calling socket_recvfrom or socket_read (in block service)? I know the non-block system call can be used, but I need to use a block system call, the block socket_recvfrom or socket_read should be either returned to be failed, or canceled when a time out is occurred. Thank you. Kind Regards, Jim -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] PHP connection to external application
On 6/13/08, Per Jessen <[EMAIL PROTECTED]> wrote: > hce wrote: > > > I am not certain if the msg_send / msg_receive in PHP can talk to the > > external C program msg_send / msg_receive as PHP and external C > > program are in different processes, different memory spaces. > > > System V message queues are intended for just that; IPC = Inter Process > Communication. > > > > (a) A simple way is if for every PHP request, it opens socket, sends a > > request and gets a response from the C server then closes the socket. > > It should work, but I am not sure: > >(i) if the open / close socket per request will cause delays and > > performance issues. > > > They will cause both delays and performance issues. But whether these > will matter for your use is a different question. The process you've > describe (open,get,close) is no different to sending an email or > getting a web-page. People send a lot of email and serve a lot of > webpages without major performance issues :-) > > > > (ii) What is the maximum number concurrent requests in a PHP web > > application? > > > That's up to your webserver - if it's big enough, you can serve a lot of > concurrent requests. > > > > Will the maximum socket number / or port number (up to 2^16) be a > > bottleneck for large number of concurrent requests (hundred > > and thousands)? > > > Probably not. > > > > (b) If for all PHP requests share only one socket to connect to the > > external C server, I am not sure if the PHP is able to do multiplex > > responses for each request as the PHP is stateless. > > > "PHP is stateless" ?? PHP is a scripting language, not a protocol. > Besides, it would take quite a bit of work to make your thousands of > concurrent PHP requests share a single socket. Sorry for not being clear here. I was saying PHP web application is stateless, not the PHP. You are right, it would take more efforts to use the share a single socket. It is not an option. Anyway, thanks for all your responses and suggestions. It was good suggestion to use SOAP and Web services, but we have very small latency requirement, I have already worried about the delay in the lower level of socket, it will be evern more processing delays for useing SOAP and Web services. I'll keep eye on that option if our processing delay requirement can be altered. Thank you. Kind Regards,. Jim -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] PHP connection to external application
On Thu, Jun 12, 2008 at 9:30 PM, Stut <[EMAIL PROTECTED]> wrote: > On 12 Jun 2008, at 12:20, hce wrote: >> >> What is the best way for a PHP web application to connect to an >> external application written by C in Linux OS? >> >> (1) Can PHP directly call external C functions, or similar solution? > > No, but you can wrap the C functions in a PHP extension. Ok, that is not an option. >> (2) Can PHP pass messages to message queue which external C program can >> access? > > Depends on the implementation of the queue, but the answer is almost > certainly yes. I am not certain if the msg_send / msg_receive in PHP can talk to the external C program msg_send / msg_receive as PHP and external C program are in different processes, different memory spaces. Unless wrap the C functions in a PHP extension as your suggested in (1). >> (3) Socket connection between the PHP and external C program. > > This would usually be my preferred choice unless there is a particular > reason to avoid this in which case I would go down the PHP extension route. > > A lot will depend on what the C code is doing and how your PHP scripts will > interact with it. Let me first describe the requirement more: The C program is a major business server which accesses the database, exchanges information to other remote servers and it has many other background tasks running concurrently for doing monitor, statistic report, real time update data, etc. The PHP web application connects to the C program to get data and information and to display on user's web browser. I know socket works between the PHP and external C server, but there are many concerns depends on different implementations: (a) A simple way is if for every PHP request, it opens socket, sends a request and gets a response from the C server then closes the socket. It should work, but I am not sure: (i) if the open / close socket per request will cause delays and performance issues. (ii) What is the maximum number concurrent requests in a PHP web application? Will the maximum socket number / or port number (up to 2^16) be a bottleneck for large number of concurrent requests (hundred and thousands)? (b) If for all PHP requests share only one socket to connect to the external C server, I am not sure if the PHP is able to do multiplex responses for each request as the PHP is stateless. Thank you. Jim -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] PHP connection to external application
Hi, What is the best way for a PHP web application to connect to an external application written by C in Linux OS? (1) Can PHP directly call external C functions, or similar solution? (2) Can PHP pass messages to message queue which external C program can access? (3) Socket connection between the PHP and externam C program. Thank you. Kind Regards, Jim -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] multithreading
Hi, 1. Does PHP support multithreading? 2. When using PHP to access MySQL, does PHP implents a single thread or multithread with MySQL? Thank you. Jim -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] $_SESSION lost
Hi, I've just installed PHP 5.2.4 on a FC 7 with a web server. $ php -v PHP 5.2.4 (cli) (built: Sep 18 2007 08:50:58) Copyright (c) 1997-2007 The PHP Group Zend Engine v2.2.0, Copyright (c) 1998-2007 Zend Technologies It seems some PHP module might be missing, I tested it with a page1.php: session_start(); $_SESSION['favcolor'] = 'green'; Then I click a link in page1.php to go another page2.php: session_start(); echo "favcolr =" . $_SESSION['favcolor']; It only displayed "favcolr =", it was empty in $_SESSION['favcolor']. The test script page1.php and page2.php are working fine on other machines. I checked with php modules, the "session" is there. What could I be missing in PHP modules or setup? Thank you. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] How to get user IP address
Hi, How to get user IP address in a PHP server? Thank you. Jim -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: install pecl in debian
On 4/12/08, hce <[EMAIL PROTECTED]> wrote: > On 4/12/08, Bojan Tesanovic <[EMAIL PROTECTED]> wrote: > > You need CLI (Comman Line interface) for PHP > > most of PECL packages are in apt-get > > > > eg apt-get php-memcache > > > > > > > > > > On Apr 12, 2008, at 3:19 AM, Shawn McKenzie wrote: > > > > > > > hce wrote: > > > > > > > Hi, > > > > I post following message days ago, but could not see it on the list. > > > > Sorry if it is duplicated. > > > > I've installed php5 in debian, but got following problems: > > > > 1. I could not find a proper debian package for pecl, search pecl > found: > > > > dh-make-php - Creates Debian source packages for PHP PEAR and PECL > > extensions > > > > php-pear - PEAR - PHP Extension and Application Repository > > > > php4-imagick - ImageMagick module for php4 > > > > php5-imagick - ImageMagick module for php5 > > > > Could anyone who have installed php in debian advise which pecl > > > > package I should install in debian? I need to install the pecl using > > > > for memcache, lighttpd and mysql. > > > > 2. I installed php5 in debian, but there is only /usr/bin/php5-cgi, no > > > > php binary fond in /usr/bin. > > > > $ dpkg -l php5 > > > > Desired=Unknown/Install/Remove/Purge/Hold > > > > | > > Status=Not/Installed/Config-files/Unpacked/Failed-config/Half-installed > > > > |/ Err?=(none)/Hold/Reinst-required/X=both-problems > > (Status,Err: uppercase=bad) > > > > ||/ Name VersionDescription > > > > > > > +++-==-==- > > > > ii php5 5.2.0-8+etch10 server-side, HTML-embedded scripting > > languag > > > > Which php package I have been missing for php command? > > > > Thank you. > > > > Kind Regards, > > > > Jim > > > > > > > Not sure about debian but ubuntu you install the individual modules, not > > all that are included in PECL. > > > > > > 1. apt-get install php5-mysql php5-lighttpd php5-memcache > > > > > > 2. apt-get install php5-cli > > > > > > -Shawn > > > > > > Thanks Shawn and Bojan. I have already insalled php5-memcache, > php5-mysql. What is the pecl package for the following error: > > Catchable fatal error: Object of class MDB2_Error could not be > converted to string I've resolved that issue. Thank you all. Kind Regards, Jim -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: install pecl in debian
On 4/12/08, Bojan Tesanovic <[EMAIL PROTECTED]> wrote: > You need CLI (Comman Line interface) for PHP > most of PECL packages are in apt-get > > eg apt-get php-memcache > > > > > On Apr 12, 2008, at 3:19 AM, Shawn McKenzie wrote: > > > > hce wrote: > > > > > Hi, > > > I post following message days ago, but could not see it on the list. > > > Sorry if it is duplicated. > > > I've installed php5 in debian, but got following problems: > > > 1. I could not find a proper debian package for pecl, search pecl found: > > > dh-make-php - Creates Debian source packages for PHP PEAR and PECL > extensions > > > php-pear - PEAR - PHP Extension and Application Repository > > > php4-imagick - ImageMagick module for php4 > > > php5-imagick - ImageMagick module for php5 > > > Could anyone who have installed php in debian advise which pecl > > > package I should install in debian? I need to install the pecl using > > > for memcache, lighttpd and mysql. > > > 2. I installed php5 in debian, but there is only /usr/bin/php5-cgi, no > > > php binary fond in /usr/bin. > > > $ dpkg -l php5 > > > Desired=Unknown/Install/Remove/Purge/Hold > > > | > Status=Not/Installed/Config-files/Unpacked/Failed-config/Half-installed > > > |/ Err?=(none)/Hold/Reinst-required/X=both-problems > (Status,Err: uppercase=bad) > > > ||/ Name VersionDescription > > > > +++-==-==- > > > ii php5 5.2.0-8+etch10 server-side, HTML-embedded scripting > languag > > > Which php package I have been missing for php command? > > > Thank you. > > > Kind Regards, > > > Jim > > > > > Not sure about debian but ubuntu you install the individual modules, not > all that are included in PECL. > > > > 1. apt-get install php5-mysql php5-lighttpd php5-memcache > > > > 2. apt-get install php5-cli > > > > -Shawn > > Thanks Shawn and Bojan. I have already insalled php5-memcache, php5-mysql. What is the pecl package for the following error: Catchable fatal error: Object of class MDB2_Error could not be converted to string Thank you. Kind Regards, Jim -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] install pecl in debian
Hi, I post following message days ago, but could not see it on the list. Sorry if it is duplicated. I've installed php5 in debian, but got following problems: 1. I could not find a proper debian package for pecl, search pecl found: dh-make-php - Creates Debian source packages for PHP PEAR and PECL extensions php-pear - PEAR - PHP Extension and Application Repository php4-imagick - ImageMagick module for php4 php5-imagick - ImageMagick module for php5 Could anyone who have installed php in debian advise which pecl package I should install in debian? I need to install the pecl using for memcache, lighttpd and mysql. 2. I installed php5 in debian, but there is only /usr/bin/php5-cgi, no php binary fond in /usr/bin. $ dpkg -l php5 Desired=Unknown/Install/Remove/Purge/Hold | Status=Not/Installed/Config-files/Unpacked/Failed-config/Half-installed |/ Err?=(none)/Hold/Reinst-required/X=both-problems (Status,Err: uppercase=bad) ||/ Name VersionDescription +++-==-==- ii php5 5.2.0-8+etch10 server-side, HTML-embedded scripting languag Which php package I have been missing for php command? Thank you. Kind Regards, Jim -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] php server installation
Hi, I've installed lighty and php5 to a FC6 box for testing php code in my local machine, I set up www.mytest.com to the /etc/hosts. I can see a page of http://www.mytest.com/index.html, but a blank page to http://www.mytest.com/index.php. I've run an command "php -l index.php", the result was "No syntax errors detected in index.php". What I was missing? Thank you. Jim -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Setting php server
Hi, I am setting a lighty and php server in my local machine FC 6 for testing my php source code. Both index.html and index.php have been set in lighty. If I have an index.html on the server, the http response was fine. But, if I set an index.php on the server, the browser got a blank page, there were no errors on browser or lighty access.log. What I could be missing? $ php --version PHP 5.1.6 (cli) (built: Sep 18 2007 09:07:04) Copyright (c) 1997-2006 The PHP Group Zend Engine v2.1.0, Copyright (c) 1998-2006 Zend Technologies Thank you. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Check XMLReader enable
Hi, How can I check if the XMLReader is enabled or not in php? Also, how to config the php to support SOAP and WSDL? Thank you. Jim -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php