i can't run php on centos 6 with webmin and virtualmin (fresh install)

<? echo phpinfo ?>

when run above php code, it is blank, but right click source code, i can see the php code that is "" in plain text....

any ideas?

link|improve this question

0% accept rate
What web server, and how is it configured? – Shane Madden Dec 30 '11 at 3:22
feedback

2 Answers

First, does that filename end in .php?

If so, can you please run:

yum list installed | grep php 

and update with the results?

My initial guess is that PHP isn't installed. Assuming you don't see something like:

php-common.i686                    5.3.2-6.el6_0.1                   @updates   
php-mysql.i686                     5.3.2-6.el6_0.1                   @updates   
php-pdo.i686                       5.3.2-6.el6_0.1                   @updates  

then you need to run

sudo yum install php -y 

which will then install php and the dependencies. At that point, you'll want to restart your web service:

sudo service httpd restart 

And try the page again.

If it was already installed and restarting the service didn't help, then we'll have to actually look at the php config section of Apache. But lets verify that this is OK first.

link|improve this answer
feedback

Try this (entire contents of the file):

<?php phpinfo();
link|improve this answer
feedback

Your Answer

 
or
required, but never shown

Not the answer you're looking for? Browse other questions tagged or ask your own question.