Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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?

share|improve this question
    
What web server, and how is it configured? –  Shane Madden Dec 30 '11 at 3:22

2 Answers 2

up vote 0 down vote accepted

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.

share|improve this answer

Try this (entire contents of the file):

<?php phpinfo();
share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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