From:             rasch at raschnet dot com
Operating system: Linux 2.4.25 (Debian unstable)
PHP version:      4.3.4
PHP Bug Type:     CGI related
Bug description:  calling PHP CLI from other CGI ignores command-line

Description:
------------
the php CGI binary detects the SERVER_SOFTWARE, SERVER_NAME,
GATEWAY_INTERFACE, REQUEST_METHOD, and then ignores all command-line
parameters.  The result is, that the below script combination prints out
the entire perl script to the web server, since it reads it, and finds 0
php start/end tags.  I needed to do the below as we're working on a
transition of some scripts from Perl to PHP.  As a workaround, i had to
change the "system" line to "unset" all the environment variables listed
above before launching the php script. 

Reproduce code:
---------------
-- perl script:
#!/usr/bin/perl

system("/path/to/script.php");


-- /path/to/script.php:
#!/usr/bin/php4 -q

print ("hello");


Expected result:
----------------
Expected the result to be "hi"

Actual result:
--------------
web server prints:
#!/usr/bin/perl

system("/path/to/script.php");



-- 
Edit bug report at http://bugs.php.net/?id=28126&edit=1
-- 
Try a CVS snapshot (php4):  http://bugs.php.net/fix.php?id=28126&r=trysnapshot4
Try a CVS snapshot (php5):  http://bugs.php.net/fix.php?id=28126&r=trysnapshot5
Fixed in CVS:               http://bugs.php.net/fix.php?id=28126&r=fixedcvs
Fixed in release:           http://bugs.php.net/fix.php?id=28126&r=alreadyfixed
Need backtrace:             http://bugs.php.net/fix.php?id=28126&r=needtrace
Need Reproduce Script:      http://bugs.php.net/fix.php?id=28126&r=needscript
Try newer version:          http://bugs.php.net/fix.php?id=28126&r=oldversion
Not developer issue:        http://bugs.php.net/fix.php?id=28126&r=support
Expected behavior:          http://bugs.php.net/fix.php?id=28126&r=notwrong
Not enough info:            http://bugs.php.net/fix.php?id=28126&r=notenoughinfo
Submitted twice:            http://bugs.php.net/fix.php?id=28126&r=submittedtwice
register_globals:           http://bugs.php.net/fix.php?id=28126&r=globals
PHP 3 support discontinued: http://bugs.php.net/fix.php?id=28126&r=php3
Daylight Savings:           http://bugs.php.net/fix.php?id=28126&r=dst
IIS Stability:              http://bugs.php.net/fix.php?id=28126&r=isapi
Install GNU Sed:            http://bugs.php.net/fix.php?id=28126&r=gnused
Floating point limitations: http://bugs.php.net/fix.php?id=28126&r=float

Reply via email to