0

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?

4
  • Any relevant httpd logs?
    – Khaled
    Nov 27, 2011 at 12:05
  • "And when trying to run a html file" Stupid question, but... does the file have .php extension? Nov 27, 2011 at 12:13
  • yeah, just added.
    – LaserBeak
    Nov 27, 2011 at 12:13
  • Is there any php related stuff in /etc/httpd/conf.d?
    – Kevin M
    Nov 27, 2011 at 13:08

4 Answers 4

0

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.

0

try to view the source code of the blank page you see, if it has phpinfo present in it, in plain text, that means php module is not working.(which i think wont be a problem).

Also try to turn off selinux, if it works.

check ownership of the file you have created (index.html)

0

Solved by doing a complete reinstall of the php packages.

According to Question author

0

This is likely due to your php files using short php tags <? instead of <?php. By default, short tags are not enabled in the php.ini config file.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .