Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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 Badia May 23 '10 at 14:52
show 1 more comment

2 Answers

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)

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
add comment

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
add comment

Your Answer

 
discard

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