Bug #14930 Updated: CLI header suppression problems
| From: | elixer@php.net | Date: | Thu, 10 Jan 2002 21:32:05 +0000 |
| Subject: | Bug #14930 Updated: CLI header suppression problems | ||
| References: | 1 | Groups: | php.dev |
| Request: | Send a blank email to php-dev+get-76534@lists.php.net to get a copy of this message | ||
ID: 14930
Updated by: elixer
Reported By: dark_panda@hotmail.com
Status: Analyzed
Bug Type: Output Control
Operating System: linux 2.4.9
PHP Version: 4.1.1
New Comment:
I don't think this is a glibc issue. Its (AFAIK) the kernel's
responsibility to set this stuff up. Take a look at load_script() in
fs/binfmt_script.c of the linux source. It seems that only one argument
is allowed, and everything after the interpreter (/usr/local/bin/php) up
until the EOL is considered one argument. I'm sure there is a reason
for implementing it this way, I just don't know what it is.
Sean
Previous Comments:
------------------------------------------------------------------------
[2002-01-08 19:29:05] edink@php.net
I was able to reproduce this. However it does not appear
to be a php bug. Most likely a glibc bug.
If I put this line on top of my script:
#!/usr/bin/php -q -c /path/to/ini/file -C
the following values get passed to
php's main() function.
argc=3
argv[0]: php
argv[1]: -q -c /path/to/ini/file -C
argv[2]: ./test (which is the name of the script)
With parameters passed like that, php has
no chance of passing them correctly.
FreeBSD systems appear to be free of this problem.
------------------------------------------------------------------------
[2002-01-08 10:54:04] dark_panda@hotmail.com
I don't know if this should go under output control but
anyways...
The command line executable is having problems suppressing
the headers using the -q option in combination with the -c
option if you're running the script as, well, a script. For
instance, take this small script:
#!/usr/local/bin/php -c /path/to/ini/file -q
<?php
echo "hello world";
?>
The headers won't be suppressed if you try running the
script with a command like
$ ./smallscript.php
X-Powered-By: PHP/4.1.1
Content-type: text/html
hello world
However, running the script like so:
$ php -q -c /path/to/ini/file smallscript.php
hello world
produces the expected result, without the headers.
Also, this may or may not be an associated bug, but if you
put the -q option before the -c option in the command line
for a script, i.e.
#!/usr/local/bin/php -q -c /some/path
<?php
...
?>
An error is produced, which looks something like this:
Error in argument 1, char 3: option not found
Error in argument 1, char 4: option not found -
Error in argument 1, char 3: option not found
along with the output from "php -h". This doesn't happen
when you execute directly from the command line, only when
the command line is in the script file itself.
J
------------------------------------------------------------------------
Edit this bug report at http://bugs.php.net/?id=14930&edit=1