Window Pear Installation PHPUnit

Source: Internet
Author: User
Install PHPUnit with pear in window
1. Installing Pear
1) on the command line, enter the PHP installation directory, such as my directory D:\php\Zend\ZendServer\bin, to run:

Go-pear
If the following error occurs:
Phar "D:\php\Zend\ZendServer\bin\PEAR\go-pear.phar" does not has 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

Workaround: Open the php.ini file and add: Phar.require_hash = Off on the last line

4) At this time pear should be installed successfully, update to the latest version:

Pear Upgrade-all
(This step is very important, PHPUnit seems to use the Pear 1.9.x to install)
2. Install PHPUnit:
1) Add 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 ' structures/graph.php '
As a workaround, download this package:

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

Unzip and copy the structures directory to the D:\php\Zend\ZendServer\bin\PEAR

If it appears:
Could not extract the package.xml file
Error:cannot Download "Phpunit/xxxx"
Maybe the path to the Pear download directory has spaces such as: D:/program files/
Here's how to fix it:

Pear config-set temp_dir "C:\tmp"
Pear config-set download_dir "C:\tmp"
Here to set the directory path without spaces on the line, want to set where to is indifferent.

The final test is whether the installation is successful, CMD running:

PHPUnit

3, ZendStudio8 Integration PHPUnit

1), first create a new project in Zend Studio.
2), in the Project project right click on the properties, click Properties in the box that appears select PHP Include Path, Libraries, Add Library, 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.