Php installation xdebug/php installation pear/phpunit detailed steps (figure) _ PHP Tutorial

Source: Internet
Author: User
Tags vc9
Detailed steps for installing xdebugphp in php to install pearphpunit (figure ). 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, because here are some practices first, this article is based on the wamp environment, so if you see that the wamp environment has not been set up, you mind setting up the environment first, because it is all practical.

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. Installation 2.1 install pear

First open the CMD command,If you use windows 7 for installation, all the subsequent 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. Finally, 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 xdebugapp extension (dll) at http://xdebug.org/download.php)

This is all versions of xdebug2.2.1. taking the first example, it appliesPhp 5.2,Compile with vc9To32-bitEnvironmentNon-thread securityXdebug, 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.