1. Technology
You can opt-out at any time. Please refer to our privacy policy for contact information.

PHP Code Showing Instead of Running

Why does your PHP code show as text instead of running?


You've gone through our tutorial and written your first PHP program, but when you go to run it all you see in your browser is the code, the program doesn't actually run. What went wrong? Well the most common reason for this is that you are trying to run it somewhere that doesn't support PHP.

If you are running PHP on a web server, make sure you have a host who is setup to run PHP. If you aren't sure, the bests way to find out is to simply e-mail them and ask.

If you are running your PHP script on a Windows computer, you need to manually install PHP. Once it is installed your browser should run your PHP programs directly from your computer.

If you are on an Apple, you already have PHP on your computer, you just need to activate it to get things working.

Related Video
Basic PHP Syntax
Using PHP With HTML
See More About
  1. About.com
  2. Technology
  3. PHP / MySQL
  4. Troubleshooting
  5. Why Does the PHP Code Show Up as Text? - Websites

©2014 About.com. All rights reserved.