Have you ever wanted to be able to test your PHP scripts without the trouble of uploading it to a web server every time? Well in this very short article I'm going to show you just how to do that.
I'll start by settling any worries you might have. This process does not require you to uninstall your operating system or in anyway affects it's operations. Now let's start. First of all you'll need a copy of XAMPP. You can download this here. XAMPP is a package containing Apache, MySQL, PHP, Perl and PhpMyAdmin (as well as a couple of extras) to allow you to turn your computer into a local server - perfect for this.
Getting it setup is a really fast 2 stage process. First of all open up the installer and follow the instructions.
Once you've got it installed, you'll need to double check that everything is running. To do this, left click the XAMPP icon in your system tray to view this window:
Once on this screen, if the services aren't running (it's easy to see on the image above that they are) click "Start" and put a tick in the "Svc" box. Easy enough?
Now let's look at how easy it is to view our files. First of all, place the following code in "testfile.php" file in the web-root you specified during the install. Mine is a folder within my documents.
<?php echo "Yay!I can test my php scripts on my computer now!"; ?>
To prove this works, visit "localhost/testfile.php" in your favourite browser. "Localhost" is the address of your local server. Nice and easy to remember. Accessing PhpMyAdmin, to administrate MySQL databases, couldn't be easier. Just visit "localhost/phpmyadmin".
I hope this short article has helped you.