Re: parser outside of web tree. whats the trick?

From: Date: Fri, 27 Jul 2001 00:06:35 +0000
Subject: Re: parser outside of web tree. whats the trick?
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-59846@lists.php.net to get a copy of this message
What this sounds like to me is that as well as having a PHP binary, that PHP is installed as a module in your web server. For whatever reason ( more than likely, the file extension ) the web server is NOT executing it as a CGI itself, but passing it to the PHP module to deal with. That is just treating the #! line as text and passing it out to the browser. You need to figure out what is going on and pick one way to do it. Brian At 22:41 25/07/2001 -0400, Darren Henderson wrote:
If I have php installed as an executable outside the web tree I can't seem to get php scripts, called as a cgi, to work correctly. When run from the command line this script.... --------------------- #!/usr/local/bin/php <?php echo "hello world\n"; ?> --------------------- Produces.... --------------------- X-Powered-By: PHP/4.0.4pl1 Content-type: text/html hello world --------------------- Just as expected. However, when called from a browser it ends up getting.... --------------------- #!/usr/local/bin/php hello world --------------------- when we view the source with a browser. If we telnet to port 80 and do a get for the url in question we find that the above is all that we get, no headers of any kind. If we add a -q the #! line we get the behavior we expect from the command line, the headers are supresed, but the browser ends up getting "No input file specified." sans headers or any html tags. Why am I seeing this behavior? I would expect the script the produce the exact same output whether it is called via the command line or as a cgi outside the web tree. I had thought that perhaps it was a system dependent bug, however, I am seeing this same behavior on several machines, AIX 4.2 running 4.06, FreeBSD 4.3 running 4.0.4.pl1, and I've found similar reports in the bug db for HP/UX etc. So... this leads me to believe I must be missing something somewhere.... anyone have any thoughts? How do I supress the printing of the #! line? It has to be in col 1 row 1, if it wasn't for that I could manually enter the headers at least and continue on my way, Where did the headers go? if I use the -q option to purposely turn off headers, I could provide my own, but if I have that option it tells me that there is no input file specified if its not invoked from the command line. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net For additional commands, e-mail: php-general-help@lists.php.net To contact the list administrators, e-mail: php-list-admin@lists.php.net
------------------------- Brian White Step Two Designs Pty Ltd - SGML, XML & HTML Consultancy Phone: +612-93197901 Web: http://www.steptwo.com.au/ Email: bwhite@steptwo.com.au

« previous php.general (#59846) next »