Test Your PHP Apps On Your Own Computer
The solution is to setup your own server. However, it can be quite difficult and time-consuming to install Apache, make the appropriate configurations, then setup and configure PHP and MySQL. Thankfully, there is an excellent free and open source Apache distribution that makes server setup as easy as it can get.
XAMPP stands for X, Apache, MySQL, PHP and Perl. The X means that XAMPP is cross-platform, including distributions for Linux, Windows and Mac OS X. Included in the package are the necessary Apache, MySQL, PHP and Perl packages, plus plenty of other useful tools such as phpMyAdmin, OpenSSL, and more.
The great thing about XAMPP is that setup is incredibly easy. The entire setup process for your server can be done in about two steps:
- Download XAMPP.
- Extract it.
Once that is done you can just fire up the server and start adding your files to the appropriate directory. Easy, huh?
After having extracted the files, your testing environment is just about setup. Add the files for your project to your htdocs directory (/opt/lampp/htdocs/ on a Linux setup), start the server, and you can then point your web browser to http://localhost/ to view your fantastic setup!
When the server is running, http://localhost/ acts as the URL from which to access your server. It can only be accessed by you, and no one else.
Another great feature in XAMPP is the fact that it is basically just a package using Apache, which can be extended with new features. For example, you can easily add support for Python and Ruby on Rails for testing your web applications.
For more information on XAMPP, check out the website, for excellent documentation and detailed installation instructions.
So you may want to consider using XAMPP if you want to have a testing environment on your computer that is quick and easy to install and setup, is very customizable and is completely free and open source. If you do not use XAMPP, what do you use for a testing environment, and why?