This article describes how to install the PHP Unit test environment PHPUnit in Windows. follow the instructions in this article to install PHPUnit in Windows, for more information, see 1. download the php zip package and configure php. ini, the example here uses E: \ php
2. add your php directory to the path of the system environment variable.
3. run cmd and switch to your php Directory. my current directory is E: \ php.
4. input go-pear.bat
First, the script will ask whether to install pear as the system range or local copy. Here we select the system by default and press enter.
5. the current path configuration is displayed, and you are asked if you want to modify it. we can press enter by default. after the press enter, the script will automatically install the pear Library.
6. during installation, the script will prompt you to set include_path in php. ini. we will set it in php. ini as required, and press enter.
7. the script will remind you to import the system variable registration file of pear, which is in your php directory.
8. press enter to complete pear installation. to test whether pear is installed, enter pear in the command line. if you see the following output, it is OK.
9. start to install PHPUnit. first, upgrade pear and enter the command
The code is as follows:
Pear upgrade pear
10. enter the following commands in sequence to add the pear channel. during addition, the system may prompt a failure due to network problems. just try it several times.
The code is as follows:
Pear channel-discover components. ez. no
Pear channel-discover pear.phpunit.de
Pear channel-discover pear.symfony-project.com
Tips:
If the following error message is prompted during adding, enable the php_openssl.dll extension in php. ini.
Unable to find the socket transport "ssl"-did you forget to enable it when you configured PHP?
11. enter the following command to start PHPUnit installation. Similarly, the installation may fail due to network problems. just try it several times.
The code is as follows:
Pear install -- alldeps -- force pear.phpunit.de/PHPUnit
Pear install pear.phpunit.de/DbUnit
12. after the command is run, PHPUnit is installed. you can enter PHPUnit to test whether the installation is successful.
If you enter the php display, your PHPUnit installation is complete.