Page 1 of 1

PHP4 not running

Posted: 2006/10/04 18:09:59
by stardent
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/
(after copying the 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.

PHP4 not running

Posted: 2006/10/05 11:41:34
by DamianS
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 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.