[Share] how to use XDebug + NetBeansIDE to build a PHP development and debugging environment

Source: Internet
Author: User
Tags php development environment
[Share] how to use XDebug + NetBeansIDE to set up a PHP development and Debugging environment for beginners? due to the failure to build a Remote & nbsp; Debugging environment, the development efficiency is very low. I am so spoiled by MS that I obviously cannot get used to this kind of Notepad + IE & nbsp; Explorer Development [share] how to use XDebug + NetBeans IDE to build a PHP development debugging environment
As a beginner in PHP development, it has never been able to build a Remote Debugging environment, resulting in low development efficiency.

I am spoiled by MS and obviously cannot get used to this development mode of Notepad + IE Explorer. Therefore, we decided to build a PHP development environment for debugging.

After reading various materials, I decided to use NB + XDebug to build the environment. The steps for setting up the environment are cumbersome.

 

1. first download NetBeans. The latest version is NetBeans 7.0. check which PHP plug-in is selected.

For convenience, I downloaded the Full Features version.

Link:

Http://netbeans.org/downloads/start.html? Platform = windows & lang = zh_CN & option = all

 

2. download the XDebug version you need.

2.1 Preparations

Before that, make sure that you have installed xampp, which is an integrated suite of PHP, Apache, MySql, and Perl. The latest version is 1.7.4 Final. A download link is also provided here.

Http://www.newhua.com/soft/50127.htm

 

2.2 Test the XAMPP installation

If everything is ready, enter http: // localhost: 80 in the browser to check whether Apache and PHP are correctly installed.

You can use phpInfo () to view the PHP feature installation.

2.3 install XDebug

XDebug is only an Extension of PHP. Go to the XDebug official website to download it.

Here we also provide

Http://xdebug.org/download.php

 

Note that there are a large number of versions, and how to choose to enable the browser again to view the output of the phpInfo function. Depending on the PHP version, the PHP Build environment (VC6 or VC9), whether it is Thread safe (TS) to select a suitable XDebug version.

 

3. configure XDebug.

Modify the XDEBUG Section of PHP. ini.

You must enable the following configuration options.

Zend_extension = "XDebug path"

For example, "zend_extension =/php/ext/php_xdebug-2.1.0-5.2-vc6.dll"

Xdebug. remote_enable = on
Xdebug. remote_handler = dbgp
Xdebug. remote_host = localhost
Xdebug. remote_port = 9000 // The default value is 9000.

Then restart the Apache service. View the configuration items under XDebug Section in phpInfo.

 

Note: It seems that PHP. ini in XAMPP has been integrated with XDebug, but only commented out. All we need to do is remove the comments.

4. Debug in NetBeans.

Go to NetBeans, create a PHP project, and write PHP code.

Then, use the "debug" menu to set breakpoints, Step into, Step over, and other common menu functions of ms ide.

After the breakpoint is broken, you can also see windows for viewing variable values such as Watch and Local. Is it quite enjoyable? from now on, you can develop a PHP program to say goodbye to the simple Notepad + browser mode. Has a php ide that is comparable to the VS development environment. More importantly, these tools are free of charge.
Share: More

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.