Click to See Complete Forum and Search --> : Debian + Apache + PHP
MrNewbie
06-09-2001, 07:48 PM
I apt-got apache and php4 but when running php scripts I got a 500 internal server error so I headed over to php.net and followed some instructions there to load a libphp4.so module which loaded fine, while I was doing this I found out I have no libperl.so and no mod_php4.c or mod_php.c files, should I have these, anyway, the problem is that I still get a 500 server error when running php scripts, is there anything else I need to apt-get to be able to use php4 with apache or is there anything I should check for/add to my httpd.conf file? From the instructions at php.net it seems I should have the ability to load some other modules or files which I currently can't. Can anyone help?
Thanks
Craig McPherson
06-09-2001, 08:48 PM
First of all, how did you install PHP? If you installed the "php4" Debian package, you're cool. You might need to have the "php4-pear" package installed also.
You need to have this line in your httpd.conf:
LoadModule php4_module /usr/lib/apache/1.3/libphp4.so
You'll need to restart Apache after you've added that line.
Make sure your PHP file is a+rx.
Here's another mistake I made: I put my PHP scripts in my CGI directory. It won't work if you do that. PHP is not CGI, they won't work if they're in a CGI directory. Put them in a normal directory like your documentroot.
Craig McPherson
06-09-2001, 08:49 PM
Also check the Apache error log, and it'll tell you what exactly the problem is.
MrNewbie
06-10-2001, 05:58 AM
Thanks! It was because they were in a cgi-bin directory.
Thanks a lot.
MrNewbie
Craig McPherson
06-10-2001, 06:12 AM
Yeah, that one took me a while to figure out also. Go figure.
Glad ya got it working! Just an FYI for anyone else trying this (I did RH, not Debian so I couldn't apt-get) but the NHF on this site for configuring apache/php/mysql is an amazing resource. I'd recommend it to anyone trying to install these services.
Sam