0

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

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

3 Answers 3

1

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:

<?php
    phpinfo();
?>

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)

1
  • I was getting to see the phpinfo, does come though, shows up as echo phpinfo()
    – user38059
    May 23, 2010 at 11:29
1

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

0

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.

You must log in to answer this question.