0

I have followed following link to configure apache2 with php5.5.4:

http://php.net/manual/en/install.unix.apache2.php

Everything got properly configured without any error. But now whenever I am trying to implement .php file, the output is looking like html file.

e.g.for following code

   <html>
   <head>
     <title>PHP Test</title>
     </head>
    <body>
    <?php echo '<p>Hello World</p>'; ?> 
    </body>
    </html>

The output in browser is:

Hello World

'; ?>

BUt in command line it is showing properly, i.e.

 <html>
 <head>
 <title>PHP Test</title>
  </head>
  <body>
  <p>Hello World</p>
  </body>
  </html> 

Please guide in this aspect, since I have wasted so much time in this but in vain. My system is Linux redhat x86_64.

2
  • You're missing the AddType or SetHandler declarations and/or you haven't restarted Apache. Also check error log to see whether mod_php encountered errors during load. Commented Oct 21, 2013 at 13:36
  • I did restart the apache with service httpd restart command. I did add whatever has mentioned in mentioned link also (php.net/manual/en/install.unix.apache2.php). If nything else is needed, please tell me. Commented Oct 21, 2013 at 13:51

1 Answer 1

1

If Apache is not interpreting PHP, then you might not have configured right steps 7 and 8 of its link. Or not restarted apache after making the change in conf (step 9).

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.