PHP4 not running

Support for webhosts that use CentOS
Post Reply
stardent
Posts: 4
Joined: 2006/10/03 21:44:37

PHP4 not running

Post by stardent » 2006/10/04 18:09:59

I have installed CentOS 4 in a new machine and am extremely pleased with it so far. I am trying to use it as a local file server over the web. We have an application where index.php redirects to another file in the same directory, var/www/htdocs/Frontpage.php. When I access the file server from another machine in the network over the web by only typing its ip address, the redirect seems to work ok - I get http:///Frontpage.php?initial=0, along with a page not found error.

I added the following lines to the httpd.conf file

AddType application/x-httpd-php .php

LoadModule php4_module modules/libphp4.so
(after copying the libphp4.so file to the modules directory - this, however, gives a warning when httpd is restarted, "php4 module is already loaded, skipping),

and modified the DocumentRoot and Directory to point to where the docs are. I also added index.php after index.html in the DirectoryIndex line.

However, the browser on the file server doesn't know what to do with the php files which makes me think that may be php installation is faulty. But then the redirect, as mentioned above, makes me wonder.
I am quite stuck at this point. Would be grateful for any help.
Thanks.

DamianS
Posts: 8
Joined: 2006/08/31 06:59:47

PHP4 not running

Post by DamianS » 2006/10/05 11:41:34

First, RedHat/CentOS does things a little bit differently to other distros.
DONT modify httpd.conf to add/modify PHP settings.

If you look in /etc/httpd/conf.d/php.conf, not only is the module being loaded, but the other things you are wanting to do have already been done! :-)
Where did you copy libphp4.so to, exactly?
It should have already been in the /usr/lib/httpd/modules directory.

It sounds like you are trying to make Apache/PHP serve files.
I have heard of this being done, but IMO it is much more efficient and secure to set up ftp accounts to serve files.

Post Reply

Return to “CentOS 4 - Webhosting Support”