How to run server side PHP scripts on my computer

25 February 2009

When testing a website on your computer you will find that you can view HTML files and link to all the images and CSS files easily.

The problem comes when you add a .php file extension and then try opening in with a web browser - all you get is a dialog to download the PHP file, which is not what we want, we wanted to view the web page as it should be, not download all the source code.

For this reason I decided to investigate running server side scripts on my local computer.

The result I came up with was called XAMPP.

XAMPP runs on your local computer as an Apache server and can handle PHP scripts and also has built in phpMyAdmin which allows you to create an online database, except not online - just on your local computer.

You can re-create the complete online experience and get everything about our website ready and tested and then export your phpMyAdmin databases and import them to your actual online database area, and also you'll just need to upload your files and all should be fine - As long as your web server is running the same version of PHP as your local virtual Apache server.

I've heard there's also other server side applications that you can use - although I wouldn't want to recommend them as I've never personally used them myself.

The XAMPP website where you can download the application is www.apachefriends.org/en/xampp-windows.html

http://www.peternichol.com/entry/trackback/33/

Current trackbacks to this blog entry are

How to run server side PHP scripts on my computer on dropjack.com
When testing a website on your computer you will find that you can view HTML files and link to all the images and CSS files easily.

The problem comes when you add a .php file extension and then try opening in with a web browser - all you get
www.dropjack.com/story/264156

Please leave a comment using the form provided.