Custom PHP Install not working


#1

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 http://www.sheth.com/cphp (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.

Thanks!


#2

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)


#3

Well, here’s the ls -l listing:
[paramount]$ cd sheth.com/cgi-bin
[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 216.165.65.90] File does not exist: /home/shethcom/sheth.com/missing.html
[Mon Feb 20 21:12:32 2006] [error] [client 24.30.151.1] Premature end of script headers: /home/shethcom/sheth.com/cgi-bin/php.cgi
[Mon Feb 20 21:12:32 2006] [error] [client 24.30.151.1] File does not exist: /home/shethcom/sheth.com/internal_error.html
[Mon Feb 20 21:12:39 2006] [error] [client 24.30.151.1] Premature end of script headers: /home/shethcom/sheth.com/cgi-bin/php.cgi
[Mon Feb 20 21:12:39 2006] [error] [client 24.30.151.1] File does not exist: /home/shethcom/sheth.com/internal_error.html

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?


#4

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.


#5

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…