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.

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

  • 2 months later...
This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.