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 did the yum install for apache, mysql, php, phpmyadmin. localhost/phpmyadmin displays correctly. I would assume PHP function correctly.

I put my webpages in /var/www/html/test_site/index.php. This page contains phpinfo. But it does not display an echo"test";

What could be wrong

Thanks Dave

share|improve this question
what does it display then? – edk May 23 '10 at 11:23
It just displays the php code – user38059 May 23 '10 at 11:24
Are you sure the PHP code is correct ? – S.Hoekstra May 23 '10 at 11:29
I used echo phpinfo(); should it not tell me its an error if its wrong. – user38059 May 23 '10 at 11:50
Don't you need a package to link Apache with PHP or something like that? – Javier May 23 '10 at 14:52

It would be useful to include sample code (more than just the echo statement - wider context is often important when debugging) in your question.

To see if PHP is doing anything at all, create a file (called something like testphpconfig.php) containing the following:


and nothing else.

Also, check the Apache logs and error logs to see if any warnings are reported there that aren't raised to the browser. You will find said logs somewhere under /var/log (/var/log/apache2/ in a default Debian install, but the location may be slightly different for your distro)

share|improve this answer
I was getting to see the phpinfo, does come though, shows up as echo phpinfo() – user38059 May 23 '10 at 11:29

In my case issue was with PHP handler. I've reverted to DSO PHP handler in cPanel and everything has worked for me. I zeroed in on PHP issue as I could load everything else (almost) from the domain such as .js, html but for php. I grew suspicious about the way PHP is and then did few combinatorics to arrive at solution. More about php handlers can be read from enter link description here

share|improve this answer

Make sure you have the php tags included in your echo file.

If David's, phpinfo page worked, then you're php is installed correctly.

Otherwise, you may need to configure your php or apache settings.

share|improve this answer

You must log in to answer this question.