Use pear to install phpunit in Windows

Source: Internet
Author: User
In window, use pear to install phpunit1. install pear1) in the command line, enter the php installation directory, for example, my Directory D: phpZendZendServerbin. run go-pear if the following error occurs: pharD: install phpunit with pear in phpZendZendServerbinPEARgo-pear.phardoesnothaveasignatur window
1. install pear
1) in the command line, go to the php installation directory, such as my Directory D: \ php \ Zend \ ZendServer \ bin, and run:

Go-pear
If the following error occurs:
Phar "D: \ php \ Zend \ ZendServer \ bin \ PEAR \ go-pear.phar" does not have a signature
Warning: require_once (phar: // go-pear.phar/index. php): failed to open stream: pha
R error: invalid url or non-existent phar "phar: // go-pear.phar/index. php" in D :\
Php \ Zend \ ZendServer \ bin \ PEAR \ go-pear.phar on line 1236

Solution: Open the php. ini file and add phar. require_hash = Off to the last line.

4) in this case, pear should be installed successfully and updated to the latest version:

Pear upgrade-all
(This step is very important. phpunit seems to be installed using pear 1.9.x)
2. install phpunit:
1) add a phpunit Channel

Pear channel-discover pear.phpunit.de
Pear channel-discover components. ez. no
Pear channel-discover pear.symfony-project.com
2) installation:

Pear install phpunit/PHPUnit
If this error occurs:
Fatal error: require_once (): Failed opening required 'ures ures/Graph. php'
The solution is as follows:

Http://download.pear.php.net/package/Structures_Graph-1.0.3.tgz

Decompress and copy the Structures directory to D: \ php \ Zend \ ZendServer \ bin \ PEAR.

If:
Cocould not extract the package. xml file
Error: cannot download "phpunit/XXXX"
The path to the pear download directory may contain spaces such as: D:/program files/
The solution is as follows:

Pear config-set temp_dir "C: \ tmp"
Pear config-set download_dir "C: \ tmp"
Here, you can set the directory path without spaces. it doesn't matter where you want to set it.

Finally, test whether the installation is successful. run the following command in cmd:

Phpunit

3. integrate phpunit with zendStudio8

1) create a new project in zend studio.
2) right-click the project and select "Properties". in the displayed Properties box, select "PHP Include Path"> "Libraries"> "Add Library" and select "PHPUnit 3.x.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.