First of all, this article is based on the WAMP environment, so, if you see here has not built a good wamp environment, mind you first set up the environment, because here are some practical content.
1. Prepare
In the WAMP environment, I use the following versions of each software
Windows 2003 Standard Edition SP2 Apache HTTP Server 2.3 mysql 5.1.49 php 5.4.5
Above the construction of the environment I will not go into the details, a lot of information on the web, usually do not have any errors, but if you use Windows 7 deploy, pay attention to the issue of permissions, all the operations using administrator rights, the next content is I want to focus on writing, Because there are often some unexpected problems that are not easy to solve.
First, you need to prepare the following
Pear package, open this URL (click here), save the downloaded file to the root of PHP, Go-pear.phar
2. Installation
2.1 Installation Pear
First open the cmd command, if you use Windows 7 installation, then all the cmd command line would mind to open with administrator privileges, of course, you can get administrator privileges on the premise.
CD to PHP installation directory (CD?) Not @ Baidu Bar),
Execute command: PHP Go-pear.phar
Enter "Local" here, carriage return
The next step is to have you enter "yes" to confirm the operation, and then you can always return to the
,
You don't have to choose 1-12.
Finally, the following prompts appear
Here you enter pear at the command line, and the result proves that pear was installed successfully,
Note that at the end of the installation you will be prompted whether to write pear's related configuration to php.ini. If you do not have sufficient permissions, the command line will help you open the php.ini (which is, of course, confirmed on the command line) waiting for you to enter the configuration information manually, and the specific configuration is already available on the command-line. All you need to do is copy and paste.
At this point, we'd better update pear to ensure that you are installing the latest version of
Using the command pear Upgrade-all
Here, you need to ensure that the network unimpeded, if you see the update process to see the error message, try more than a few times
At this point, pear has been installed and updated to the latest version
2.2 Installation PHPUnit
First add channels to pear, and then execute the following command in the PHP directory:
Pear Channel-discover pear.phpunit.de
Pear Channel-discover components.ez.no
Pear Channel-discover pear.symfony-project.com
Next, install PHPUnit and execute the following command
Pear Install Phpunit/phpunit
If your network is not good, you may need to wait a few minutes, you need to download some tgz package, and finally, if you see the following similar information to prove that you have been installed successfully
At this point in the PHP root directory, you can see phpunit.bat this file, and in the command line input phpunit, you can see the appropriate help information to prove that the installation was successful.
But, but!!! At this point, if you need to use selenium to test, there is also a very important thing to install, such as in the Yii test, many are using selenium.
In the root directory of PHP, continue with the following command:
Pear Install Phpunit/phpunit_selenium
If the network is unblocked, it should be the result
2.3 Installation Xdebug
First, identify the following elements in your environment
PHP Version number PHP is a thread-safe version PHP environment is 32-bit or 64-bit
Then go to http://xdebug.org/download.php to download the corresponding Xdebug application extension (DLL)
This is xdebug2.2.1 all versions, take the first example, it is suitable for PHP 5.2 version , using VC9 compiled to 32-bit environment, not thread-safe xdebug, The TS here is the meaning of thread safe, so there is no such thing as the meaning of no thread safe.
Place the downloaded file in the PHP root directory/ext, and then open the System directory/windows/php.ini add the following
zend_extension= "F:\php_dev\php\ext\php_xdebug-2.2.1-5.4-vc9.dll"
[Xdebug]
Xdebug.auto_trace=on
Xdebug.collect_params=on
Xdebug.collect_return=on
Xdebug.profiler_enable=on
Xdebug.trace_output_dir= "F:\php_dev\temp"
Xdebug.profiler_output_dir= "F:\php_dev\temp"
Xdebug.remote_enable=on
Xdebug.remote_handler=dbgp
Xdebug.remote_host=localhost
xdebug.remote_port=8888
Here a lot of specific configuration, I do not repeat, the specific configuration content you can view through here
When you open the Phpinfo, you can see the concrete xdebug.
!!!!!!