ID: 24305 User updated by: ciaraldi at ciaraldi dot com Reported By: ciaraldi at ciaraldi dot com -Status: Bogus +Status: Open Bug Type: CGI related Operating System: Red Hat Linux 9 PHP Version: 4.3.2 New Comment:
Does anyone have any further ideas on this? Specifically, PHP 4.3.2 looks at various environment variables to decide if it is being called as CGI, rather than being run directly from the shell. When it gets invoked by Apache, PHP decides it is being called as CGI, then looks in the environment variable PATH_TRANSLATED for the name of the script file. My Apache does not fill in this environment variable. Do I have to configure Apache to do this? As I mentioned earlier, this is the same Apache with the same httpd.conf file. The old PHP 4.2.1 worked fine with it, but 4.3.2 does not. Previous Comments: ------------------------------------------------------------------------ [2003-06-24 12:24:55] ciaraldi at ciaraldi dot com Can you be more specific? My Apache setup is the same as it has been for the last year, and PHP 4.2.1 worked fine with it. Is there a change to how Apache should be set up because of changes in PHP? ------------------------------------------------------------------------ [2003-06-23 21:56:45] [EMAIL PROTECTED] Setup your apache correctly and it works. ------------------------------------------------------------------------ [2003-06-23 21:11:06] ciaraldi at ciaraldi dot com 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 this bug report at http://bugs.php.net/?id=24305&edit=1