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
<html><body>
<?php
echo "hello world\n";
?>
</body></html>
---------------------
Produces....
---------------------
X-Powered-By: PHP/4.0.4pl1
Content-type: text/html
<html><body>
hello world
</body></html>
---------------------
Just as expected. However, when called from a browser it ends up getting....
---------------------
#!/usr/local/bin/php
<html><body>
hello world
</body></html>
---------------------
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: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]