Dailytip.net

Articles on pretty much anything.

About the author

Author Name is someone.
E-mail me Send mail

Recent posts

Recent comments

Tags

Disclaimer

The opinions expressed herein are my own personal opinions and do not represent my employer's view in anyway.

© Copyright 2008


Turning your PC into a local server!

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.

First

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:

Second

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.

Currently rated 4.4 by 5 people

  • Currently 4.4/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

Posted by Andy on Wednesday, March 12, 2008 5:45 AM
Permalink | Comments (0) | Post RSSRSS comment feed

Related posts

Add comment


(Will show your Gravatar icon)  

  Country flag

[b][/b] - [i][/i] - [u][/u]- [quote][/quote]



Live preview

Saturday, July 05, 2008 3:21 AM