Recipe 20.16. Setting Up a Test Environment

20.16.1. Problem

You want to test out PHP scripts without worrying about bringing your web site down or contaminating your production environment.

20.16.2. Solution

Set up a test environment for your application on your desktop machine, using XAMPP.

20.16.3. Discussion

The complexity of setting up a localized running environment for your web application frequently deters developers from taking that step. The result is often a breakdown in development best practices, such as editing files on the production web site as a privileged user'never a good idea!

The XAMPP project provides single-installer solutions for four platforms: Windows 98/NT/2000/XP, Mac OS X, Linux (SuSE/RedHat/Mandrake/Debian), and Solaris. The packages contain synchronized versions of Apache, MySQL , PHP and PEAR, phpMyAdmin, and eAccelerator.

With an easy, step-by-step installation procedure, the XAMPP project makes creating a web-application-running environment on your local machine a snap.

Dealing with a large dataset? Unfortunately, developers working with sites that deal extensively with content that changes frequently find that they let best practices development habits slip due to a lack of good test data to work with. Don't let this happen to you! Simply write a script that mirrors your data structure locally, and then peroidically update your local copy of data with a subset snapshot of the complete data set. That way you're easily able to pull in a current copy of relevant data that's large enough to be used for real testing and development purposes.

20.16.4. See Also

The XAMPP project home page at

PHP Cookbook, 2nd Edition
PHP Cookbook: Solutions and Examples for PHP Programmers
ISBN: 0596101015
EAN: 2147483647
Year: 2006
Pages: 445

Similar book on Amazon © 2008-2017.
If you may any questions please contact us: