Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have installed Centos 5.x, Apache 2.2, PHP 5.3 and MySQL 5.5. I also installed phpMyAdmin. I am able to access phpMyAdmin through the browser without any issues. However, when I create a simple index.php with phpinfo() function in the default directory, that page is served without php parsing.

As we all know, phpMyAdmin is a php application. This is working fine from the same server but not the simple php page from the doc root directory ??!!!. Of course, I tried moving this page into phpMyAdmin folder and tried accessing it, but no success.

Please note that I updated httpd.conf file with appropriate directives based on the php installation guide.

docroot - /var/www/html
phpMyAdmin folder - /var/www/html/phpMyAdmin

Any help is appreciated.

share|improve this question

Make sure you have a line like LoadModule php5_module "/usr/local/php" in your Apache httpd.conf so that Apache knows to use PHP, and make sure you have a line like AddType application/x-httpd-php .php so that Apache knows when to use it.

share|improve this answer
    
I do already have those directives in the httpd.conf file. Just figured out the problem from another forum. Thank you anyway for your help. – infotoknowledge Aug 31 '12 at 9:41

I figured out that the problem was nothing to do with my above configuration. It was the short tags I used in index.php that caused the problem. Either I should have used the default tags ("?php") or modified the php.ini to enable the short tags with appropriate directives.

Thanks to all those responded.

share|improve this answer

You must log in to answer this question.

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