• 15
• 15
• 11
• 9
• 10

# Help, browser is not parsing php file?

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

## 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 on other sites
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.

Thanks.

##### 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.