PHP Must Die.
Feb. 16th, 2007 11:23 amSo, for reasons that are not mine to question, I need both PHP4 and PHP5 running on the same machine. EDIT: It's no longer my problem, as PHP5 has been declared officially Good Enough Dammit.
According to all the documentation I have, this means setting one (or both) to run through CGI, and the other (or neither) to run as a module.
PHP5 is currently working, as an Apache module.
I've downloaded, built, and installed CGI-PHP4.
I've added the following to httpd.conf:
This SHOULD mean that all files with a PHP4 extension will get executed with the CGI PHP4, instead of the module PHP5.
Then, when I restart Apache and try to work this, and hit my nice convenient testPHP.php4 file, it give me this:
And I have no idea why it's doing this.
("cat /var/www/html/testPHP.php | /var/www/cgi-bin/php" gives perfectly good PHP4 results.)
I hate PHP.
According to all the documentation I have, this means setting one (or both) to run through CGI, and the other (or neither) to run as a module.
PHP5 is currently working, as an Apache module.
I've downloaded, built, and installed CGI-PHP4.
I've added the following to httpd.conf:
AddHandler php-script .php4and symlinked /cgi-bin/php4 to /usr/local/bin/php which is the executable for CGI-PHP4. I've also tried copying the executable into that location directly.
Action php-script /cgi-bin/php4
This SHOULD mean that all files with a PHP4 extension will get executed with the CGI PHP4, instead of the module PHP5.
Then, when I restart Apache and try to work this, and hit my nice convenient testPHP.php4 file, it give me this:
The requested URL /var/www/cgi-bin/php4/testPHP.php4 was not found on this server.- meaning it's not RUNNING cgi-bin/php4 and passing it the php file to parse, it's redirecting the file lookup to treat cgi-bin/php4 as a DIRECTORY.
And I have no idea why it's doing this.
("cat /var/www/html/testPHP.php | /var/www/cgi-bin/php" gives perfectly good PHP4 results.)
I hate PHP.
(no subject)
Date: 2007-02-16 04:35 pm (UTC)Apache can't run symlinks out of cgi-bin, and if the php4 executable needs something out there in the big wide world that apache isn't allowed to access (ie, did you compile it as a static binary?), it's going to fail when you try to access it as a web request.
(no subject)
Date: 2007-02-16 04:49 pm (UTC)But the issue has been resolved the simple way: "We don't really need PHP4 anyway".