Jump to content

Apache 2.2 server displays the code itself...doesn't compile as php or html


Recommended Posts

I downloaded and installed Apache 2.2 and the Eclipse PHP developer platform. I got them to work fine together, however whenever I produce a PHP/html code it displays it exactly as its written, as opposed to being compiled and displayed.

 

For example, the code is as follows:

<html>

<body>

<?php

echo 'hi';

?>

</body>

</html>

 

When saved and run through the Apache server, it displays the exact text as opposed to "hi" as it's supposed to. The address I have for the server file to be run is http://localhost/Folder/file.php

 

What am I doing wrong? Does the server need to be specifically configured to compile php and html code? If yes, how do I do so?

 

Thank you very much in advance.

What operating system are you running?  Did you install php?  The first thing you should do is create a script named test.php or something similar in your webroot with this in it:

 


 

That should come back with information about php but i suspect you don't have php installed, or at least not installed correctly.

  • 2 months later...

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.