PHP Development Environment Build (Xampp+xdebug+netbeans, configure debugging), create the first PHP project ____php

Source: Internet
Author: User
Tags php development environment phpinfo netbeans

The main reference to this is as follows:

Without a remote debugging environment, the development efficiency is extremely low.

Habitual operation, apparently unable to get used to this Notepad +ie Explorer's development model. So decided to build a debug PHP development environment.

I decided to use Nb+xdebug to build the environment after reading many information. As the steps of setting up the environment are slightly cumbersome, we hereby record them for forgetting.

0. Download and install the JDK with NetBeans (NB), install

1, first to download NetBeans, the latest version is NetBeans 7.0, note which one with the PHP plug-in.

For convenience, I downloaded the full features version.

to a link:


2, download the version of the xdebug you need.

2.1 Preparation work

Before you do this, make sure you have a xampp, a combination of PHP and Apache,mysql,perl. Currently the latest version is 1.7.4 Final. Here also gives a download link


2.2 Test XAMPP Installation

If everything is ready, the browser enters http://localhost:80 to see if the apache,php is properly installed.

You can use Phpinfo () to view the installation of PHP features.

2.3 Installation Xdebug

Xdebug is just a extension of PHP. Go to Xdebug's official website to download.

Here also gives a download address

Note that there are many versions here, how to choose to open the browser again to view the output of the Phpinfo function. Depending on the PHP version, the PHP build environment (VC6 or VC9) is thread safe (TS) to select a suitable version of Xdebug.

The configuration of the 3,xdebug.

Modify the Xdebug section of the php.ini.

You need to be sure to turn on several configuration options, which are generally recommended for the following options.

zend_extension= "Path of Xdebug"

such as "zend_extension=/php/ext/php_xdebug-2.1.0-5.2-vc6.dll"

xdebug. Remote_enable=on
xdebug. remote_host=localhost
xdebug. remote_port=9000//default is 9000 suggest that.

Then restart the Apache service. View the configuration items under Xdebug section in Phpinfo.

Description, seemingly xampp in the php.ini has been integrated xdebug just note up. All we have to do is get rid of the annotations.

Debug in 4,netbeans.

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

Then use the set breakpoints under the Debug menu to step in (step Into), and the Common IDE menu feature items for MS such as steps over.

Once the breakpoint is broken, you can also see window, such as watch,local, to view the value of the variable. is not feeling very enjoyable, from the development of PHP program can say goodbye to the simple Notepad + browser mode. Have a PHP IDE that is comparable to the VS development environment. More importantly, this series of tools is free.

In fact, the steps are simple.

In fact, XAMPP has been set up, but is only a comment.

Open the Php/php.ini in the XAMPP installation directory

Found it

Zend_extension = "D:\xampp\php\ext\php_xdebug.dll"

Remove the comment for this line (start this line)

And at the end add:


(In fact, these are the following words NetBeans prompts to join)

Restart Apache, get it.

The following is the creation of the first PHP project

1. New PHP Project
1 Select File->new Project.
2 Select Php->php Project from the dialog box, and enter the item name Firsttest.
3 in configured server, select Localhost,context Path input/test.

2. Edit PHP file
Expand source Files, double-click the index.php file, and enter the test code.
Enter phpinfo between the <?php?> ();
You can use Ctrl+space for code completion.

3. Running the project
Right-click the project node and select Run project to see the results of phpinfo ().

This blog is reproduced version, thank you

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: 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.