Detailed steps for installing xdebug/php in php to install pear/phpunit (figure)

Source: Internet
Author: User
Tags vc9
Install pear, phpunit, and xdebug in the PHP environment.

Install pear, phpunit, and xdebug in the PHP environment.

First of all, this article is based on the wamp environment, so if you see that the wamp environment has not been set up here, you mind setting up the environment first, this is because there are some practical content here.

1. Prepare

In the wamp environment, the versions of each software I use are as follows:

Windows 2003 Standard Edition SP2 apache HTTP Server 2.3 mysql 5.1.49 php 5.4.5

I will not go into details about setting up the above environment. There are a lot of online materials and there are usually no errors. But if you use windows 7 for deployment, pay attention to the permission issue, all operations use the Administrator permission. The next content is what I want to rewrite, because there are often unexpected and difficult problems to solve.

First, prepare the following content:

Pear package, open this URL (Click here), save the downloaded file to the php root directory, go-pear.phar

2. Install pear 2.1

First, open the CMD command. If you use windows 7 for installation, then all the CMD command lines will be opened with the Administrator permission. Of course, you can obtain the Administrator permission.

Cd to the php installation directory (will cd be? No @ Baidu ),

Execute the command: php go-pear.phar

Enter "local" here and press ENTER

Next, let you enter "yes" to confirm the operation, and press enter all the time.

,

No need to select 1-12

The following prompt appears:

Enter pear in the command line to verify that the pear is successfully installed,

Note: During installation, you will be prompted whether to write pear configurations to php. if you do not have sufficient permissions in ini, the command line will help you open php. ini (confirmed by you in the command line of course) waits for you to manually enter the configuration information, the specific configuration content has been provided in the command line, you only need to copy and paste it.

In this case, we 'd better update pear to ensure that you have installed the latest version.

Run the pear upgrade-all command.

Here, you must ensure that the network is smooth. If you see an error message during the update process, try it several times.

Now, pear has been installed and updated to the latest version.

2.2 install phpunit

First, add channels to pear and execute the following commands in the php Directory in sequence:

Pear channel-discover pear.phpunit.de

Pear channel-discover components. ez. no

Pear channel-discover pear.symfony-project.com

Run the following command to install phpunit:

Pear install phpunit/PHPUnit

If your network speed is not good, it may take several minutes to download some tgz packages online. If you see the following similar information, it proves that you have successfully installed

In the php root directory, you can see the phpunit. bat file and enter phpunit in the command line to see the corresponding help information, proving that the installation was successful.

However !!! In this case, if you want to use Selenium for testing, there is also a very important thing to install. For example, in YII testing, many of them use Selenium.

Run the following command in the PHP root directory:

Pear install phpunit/PHPUnit_Selenium

This is the result if the network is smooth.

2.3 install Xdebug

First, determine the following items in your environment

Php version: is php a thread-safe version? Is the php Environment 32-bit or 64-bit?

Then download the corresponding xdebug application extension (dll)

This is all versions of xdebug2.2.1. Taking the first example, xdebug is applicable to php 5.2 and compiled to a 32-bit environment using vc9 for non-thread security, TS here is the meaning of Thread Safe, so No Thread Safe is the meaning without this mark.

Put the downloaded file in the php root directory/ext, and then open the system directory/windows/php. ini to add the following content:

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

I will not repeat the specific configuration here. You can view the specific configuration content here.

Open phpinfo and you will be able to see the specific xdebug.

This is a success !!!!!!

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.