Jump to content

Problem running PHP code


Recommended Posts

Hi Guyz.. :)

M just new to PHP. Learning stage. Been struck up in a big mess :'(. My question sounds silly, but Any help will be appreciated.

 

My Browser is not detecting php code in test.html page.

<html>

      <title>

            This is a test page

      </title>

      <br> This is a code before PHP

      <?php echo "This is a php code"; ?>

      <br> this is a code after PHP

</html>

 

When I run this page using http://localhost/test.html, it is just displaying the content between HTML tags. But does not showing the code. ???

 

Now I will tell you what mess did I do. First I have installed easyPhp software. It worked fine n excellent. I could create some sample php code and executed them.

 

Later I got a brilliant idea which drowned me :o. I wanted to learn how to install old fashion php(installing each of the components individually, downloading the latest verisions of php, apache, mysql from their respective websites).

 

Downloaded, installed them according to the instructions given on learning php by WROX publications. It went fine for the first step. It showed success when i executed http://localhost/ . Showed the index page. Then started a big problem..

 

When I try to execute a new file ex. http://localhost/test.html or test.php instead opening the content, it started asking me to download and save file!!! :o really surprised. So thought of reversing the situation I tried to uninstall all the php, apache, mysql from  my system and installed easyPhp again. But this time php code is not executing, only html content is displayed.

 

I know formatting the system is the easiest sollution.

But want to know the error why it is not displaying the php code only html content is displayed.

 

Please help me!!!

Thanks.

Rakesh

 

Link to comment
https://forums.phpfreaks.com/topic/163022-problem-running-php-code/
Share on other sites

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.