Custom PHP Install not working

I followed the instructions in the wiki to build my own PHP installation. However, I get 500 Internal Server Error anytime I attempt to use the php.cgi created via the script. If I remove the handler and action from my .htaccess, (reverting back to the DH php), it all works fine.

Not that it’ll help, but I copied the .htaccess with the custom PHP build to (so I could leave my main site running with a working php).

It’s PHP 4.4.2. I did change the permissions on the file. I also was able to execute a .php file against php.cgi.


A couple things, if you’re gonna compile PHP, I’d highly suggest to goto PHP5 if you can. :wink:

Secondly, it could be a number of things. Need to check your error log to see what’s wrong.

500 error could be a problem with the PHP binary or it could be a typo in the .htaccess file. Can’t say either way without added information and troubleshooting (ie: where’s the PHP binary? ls -l of the directory. What’s in the .htaccess file, etc)

Well, here’s the ls -l listing:
[paramount]$ cd
[paramount]$ ls -l
total 9124
-rwxrwxrwx 1 shethcom pg517232 9328497 2006-02-20 16:56 php.cgi

And the .htaccess:
AddHandler PhpFour .php
Action PhpFour /cgi-bin/php.cgi

From the error log:
[Mon Feb 20 21:01:48 2006] [error] [client] File does not exist: /home/shethcom/
[Mon Feb 20 21:12:32 2006] [error] [client] Premature end of script headers: /home/shethcom/
[Mon Feb 20 21:12:32 2006] [error] [client] File does not exist: /home/shethcom/
[Mon Feb 20 21:12:39 2006] [error] [client] Premature end of script headers: /home/shethcom/
[Mon Feb 20 21:12:39 2006] [error] [client] File does not exist: /home/shethcom/

I was able to do more searches based on this and decided to goto $HOME/ and do a chmod:
chmod -R 755 *

Voila! My page (just a phpinfo() output) comes up!

So now the next weird thing was that my Joomla no longer let me login. Any attempt to login (submit) returned me to my previous spot. Some more investigation let me to the fact that my post_max_size was too big (I wanted to be able to upload BIG files).

I must be burning through my 60 minutes of CPU time today… :slight_smile: Sorry to anyone else on paramount today.

I considered PHP5, but what’s the advantage?

Glad you got it working. I wouldn’t have done 755 permissions though. 750 is more secure and would suffice due to how the servers are setup. :wink:

More efficient. Better OO model. Exception handling. The next level of PHP development. Lots of added misc goodies to different functions. PDO, PHP Database Object. And much more. It’s really just a good idea to upgrade to PHP5 if there’s nothing “forcing” you to keep on PHP4.

I told it to use PHP5 in the panel (removed my .htaccess) to see how it performed. It seemed slower.

Overall, though, I think DH is pretty slow in response times to pages… I’m wondering how much of that is because mySql sits outside of the server and it requires a remote call…