From: ciaraldi at ciaraldi dot com Operating system: Red Hat Linux 9 PHP version: 4.3.2 PHP Bug Type: CGI related Bug description: PHP cannot find script when called as CGI
Description: ------------ I had been running an old PHP (4.2.1) on my Linux box. When I upgraded to Red Hat 9, the old PHP binary immediately crashed, probably due to library changes. I downloaded PHP 4.3.2 and it compiled and installed fine. But when I tried to run PHP scripts as CGI under Apache 1.3.27 (the same scripts that ran fine before, and the same version of Apache, with the same INI files for both PHP and Apache), PHP gave the message "No input file specified." It seems that Apache passes the name of the script to PHP as a command-line argument, and this version of PHP is not looking for it there. I managed to patch cgi_main.c so it works, but I am not sure that I have not broken something else. See the next box for the patched code; I changed it in two places, marked with a comment which says "HACK". Reproduce code: --------------- Here is the patched code: http://poppy.ind.wpi.edu/~ciaraldi/cgi_main.c Typical script: #!/usr/local/bin/php <?php print("Hello"); ?> Expected result: ---------------- Hello Actual result: -------------- No input file specified. -- Edit bug report at http://bugs.php.net/?id=24305&edit=1 -- Try a CVS snapshot: http://bugs.php.net/fix.php?id=24305&r=trysnapshot Fixed in CVS: http://bugs.php.net/fix.php?id=24305&r=fixedcvs Fixed in release: http://bugs.php.net/fix.php?id=24305&r=alreadyfixed Need backtrace: http://bugs.php.net/fix.php?id=24305&r=needtrace Try newer version: http://bugs.php.net/fix.php?id=24305&r=oldversion Not developer issue: http://bugs.php.net/fix.php?id=24305&r=support Expected behavior: http://bugs.php.net/fix.php?id=24305&r=notwrong Not enough info: http://bugs.php.net/fix.php?id=24305&r=notenoughinfo Submitted twice: http://bugs.php.net/fix.php?id=24305&r=submittedtwice register_globals: http://bugs.php.net/fix.php?id=24305&r=globals PHP 3 support discontinued: http://bugs.php.net/fix.php?id=24305&r=php3 Daylight Savings: http://bugs.php.net/fix.php?id=24305&r=dst IIS Stability: http://bugs.php.net/fix.php?id=24305&r=isapi Install GNU Sed: http://bugs.php.net/fix.php?id=24305&r=gnused