|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2004-04-23 17:47 UTC] iliaa@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sun Dec 14 04:00:01 2025 UTC |
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");