Linux – PHP 5 will not work in Centos 6 for me

apache-2.2centoslinuxPHPredhat

Just created a new install of Centos 6.0 64-bit on a virtual machine and running on Vmware workstation 8, windows host.

yum install php
service httpd restart

And when trying to run a html file from the var\www\html dir
which just has <?php phpinfo(); ?> in it or pointing browser to localhost. Nothing comes up.

Also opened up httpd.conf and added:

AddType application/x-httpd-php .php
AddType application/x-httpd-php-source .phps

Tried reinstalling, installing php-common, then php etc. to no avail.
Otherwise going for the typical LAMP.

installed:

php.x86_64              5.3.2-6.el6_0.1 @updates                                
php-cli.x86_64          5.3.2-6.el6_0.1 @updates                                
php-common.x86_64       5.3.2-6.el6_0.1 @updates 

Yet to update to Centos 6.1

PHP5 is probably comes installed by default with Centos and I
maybe stuffed it up by running yum install php?

Best Answer

No need to edit httpd.conf. PHP is includes it's binding from /etc/httpd/conf.d/php.conf, which is included by include directive at httpd.conf. It's enough to check php.conf and ensure that all required lines are not commented. It should work by default with prefork httpd. Probably something was wrong with your php.conf.

Related Topic