Building a PHP Test Environment in Windows
Building a PHP test environment on Windows is a three step process:
- Install “Microsoft Visual C++ 2008 Redistributable Package (x86)”.
- Install the latest version of PHP 5.2.
- Install the latest version of PHP 5.3.
We recommend you run tests you've written against the three main branches of PHP: 5.2, 5.3 and Trunk. Unfortunately, Trunk is not currently being compiled and packaged, so we'll have to stick to 5.2 and 5.3 for now.
Install “Microsoft Visual C++ 2008 Redistributable Package (x86)”
The PHP binaries you'll be using in this test environment require the “Microsoft Visual C++ 2008 Redistribution Package (x86)” in order to run. Please download and install this package. Please note, we recommend the (x86) package even if you are running on a 64-bit version of Windows.
Install the Latest Version of PHP 5.2
- Visit the PHP Windows Download page. Download the “Zip” file of the latest version of “VC6 x86 Non Thread Safe” for PHP 5.2. Do not download the “Installer” or “Debug Package”. When downloading, save the file to a location you plan to use for your PHPT development and testing.
- Unzip the file you downloaded. Rename the unzipped folder to “php52”.
You now have a PHP 5.2 testing environment ready for running PHPTs against PHP 5.2. Inside the “php52” folder, you'll see the php.exe binary which is suitable for running PHPTs.
Install the latest version of PHP 5.3
- Visit the PHP Windows Download page. Download the “Zip” file of the latest version of “VC9 x86 Non Thread Safe” for PHP 5.3. Do not download the “Installer” or “Debug Package”. When downloading, save the file to a location you plan to use for your PHPT development and testing.
- Unzip the file you downloaded. Rename the unzipped folder to “php53”.
You now have a PHP 5.3 testing environment ready for running PHPTs against PHP 5.3. Inside the “php53” folder, you'll see the php.exe binary which is suitable for running PHPTs.
Screencast
Watch a Screencast demonstration of this entire process. Screencast demonstration.