Build a PHP testing and development environment under WIN

Source: Internet
Author: User
Tags netbeans
After two days of hard work, I found a lot of information on the Internet to set up the PHP debugging environment. Here I will summarize the construction process and precautions: [environment Introduction] operating system: WIN7WAMP version: wampServerVersion2.1 (Apache2.2.17, PHP5.3.3, and MYSQL5.5.8) NETBEANS version: NetBeansIDE7.0 (Build20110408000

After two days of hard work, I found a lot of information on the Internet to set up the PHP debugging environment. Here I will summarize the construction process and precautions: [environment Introduction] operating system: WIN7 WAMP version: wampServer Version 2.1 (Apache2.2.17, PHP5.3.3, and MYSQL5.5.8) NETBEANS Version: NetBeans IDE 7.0 (Build 20110408000

After two days, I found a lot of information on the Internet to debug PHP.EnvironmentBuildOkay. Here is a summary.BuildProcess and precautions

EnvironmentIntroduction]

Operating System: WIN7

WAMP Version: WampServer Version 2.1 (Apache2.2.17, PHP5.3.3, and MYSQL5.5.8)

NETBEANS version: NetBeans IDE 7.0 (Build 201104080000)

XDEBUG version: 2.1.1 (PHP 5.3 VC6 TS (32 bit ))

Note: The XDEBUG official website provides multiple versions for the win system. Each version involves VC6, VC9, and TC. You can learn more about the specific meaning by choosing the PHP version (thanksMeow.Suggestions in this article)

[Install XDEBUG]

Copy the downloaded php_xdebug-2.1.1-5.3-vc6.dll to the ext folder under the php installation directory

The installation directory of WAMP on my computer is: D: \ Wamp

I copied to E: \ wamp \ bin \ php \ php5.3.3 \ ext here

Add the following code to the end of php. ini.

zend_extension ="E:/wamp/bin/php/php5.3.3/ext/php_xdebug-2.1.1-5.3-vc6.dll"xdebug.remote_enable=onxdebug.remote_handler=dbgpxdebug.remote_host=localhostxdebug.remote_port=9000

Note:

1. Many documents and tutorials on the Internet are "zend_extension_ts =", and xdebug has clearly pointed out that PHP5.3 has been replaced by zend_extension.

2. xdebug and zendOptimizerAndDebugger extensionsIncompatible, so if you have installed these two extensions before, you need to delete them in php. ini.

[Zend];zend_extension_ts = "C:\xampp\php\zendOptimizer\lib\ZendExtensionManager.dll";zend_extension_manager.optimizer_ts = "C:\xampp\php\zendOptimizer\lib\Optimizer";zend_optimizer.enable_loader = 0;zend_optimizer.optimization_level=15;zend_optimizer.license_path =; Local Variables:; tab-width: 4; Local Variables:; tab-width: 4; End:

After all the above work is completed, you need to restart WAMP (in fact, restart Apache) and open PHPINFO. If you can find the Xdebug extension shown in, congratulations, you have installed it successfully.

[Configure NetBeans]

Start NetBeans, open tool-> Option-> PHP-> debugging. Check whether the debugger port is set to 9000 (the default value is 9000)

"Stop on the first line" is selected by default. In this way, even if no breakpoint is set during any debugging, it will be stopped at the first line of the program. As shown in:

After setting, you can use the NetBeans debugging-> debugging file (or press Ctrl + Shift + F5). By default, the program runs on the first line and is interrupted.

[Extended Reading]

For more information about installing PEAR extensions, see http://www.cnblogs.com/Excellent

[References]

NetBeans wiki: About how to install Xdebug in different operating systems, but the PHP5.2 is used as an example.

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.