Jump to content
  • Advertisement
Sign in to follow this  
Concentrate

Help, browser is not parsing php file?

This topic is 2708 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I have a simple php file that has this :

<?php
phpinfo();
?>


I wrote it in a text file but saved it with an .php extension. But when I run it, the browser just spits out the code and does nothing? How can I fix this?

Share this post


Link to post
Share on other sites
Advertisement
Web browsers don't parse php code, web servers parse php code and send html (or scripts) to the web browser. If you want to write php code locally you need some sort of webserver like Apache with php installed.

Share this post


Link to post
Share on other sites
On an additional note: installing Apache can be a pain in the butt. You'll very likely need to follow an online tutorial. Alternatively you can download something like xampp which will take care of everything for you...at which point you'll just need to drop your php file in the htdocs folder that xampp creates to run it on a local server.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!