eclipse+php plugin +xdebug Preparation PHP Perfect Development/Commissioning Environment guide

Source: Internet
Author: User
Tags php server zend framework
eclipse+php plugin +xdebug build php perfect dev/debug Environment guide

Recently to start using the Zend Framework to develop medium-sized applications, because the use of a fully object-oriented framework to develop programs, not only the development of ideas, the previous Editplus+dreamweaver editor combination obviously can not meet my requirements. My new environment was initially set as ECLIPSE+PDT plugin +xdebug+apache (the most popular Web server platform for UNIX platforms).

Previous has been to dotnet, Java IDE Code automatic sniffing, code hints, program breakpoint debugging and so on automation function envy unceasingly, but oneself writes PHP only relies on Echo, Var_dump () to debug the program, can let PHP also implement breakpoint debugging? Previously found in the Eclipse PHP plugin debug options, indicating that the debugging function should be feasible, but do not know how to configure the method, ran Google find data found not a complete description of the configuration document, I can only connect the information obtained to later test.

The result: Perfect PHP breakpoint Debugging!

=====================================================

This article is the original article, reproduced please indicate the article originated from the idea of the land, the author: Hazy Evil

=====================================================

Here is the detailed procedure.

Step One:

1. First download and install the appropriate software

JDK is absolutely necessary, it is the most basic requirement to run Eclipse, download here.

Eclipse has integrated the PHP development plugin version here to download, select the corresponding version of the operating system to download to local.

Xdebug to download here, please select the appropriate file to download according to your PHP version.

Servers, it is recommended to use Apache (the most popular Web server platform for UNIX platforms) +php module installation method.

2. Software Installation

After installing the JDK first, please follow the steps below to configure the system variables.

Next is the installation Eclipse,eclipse not how to set up, as long as the set jdk,eclipse placed in any position can be directly run

Final Xdebug Installation

I am using PHP5.2.5, download the Xdebug file named: Php_xdebug-2.0.3-5.2.5.dll, put the file in the Php/ext folder can be

?

Xdebug Configuration

Open php.ini

Add the following configuration code to the last line, and the configuration instructions are already commented

; Load into Xdebug

Zend_extension_ts= "C:/php/ext/php_xdebug.dll"

; Xdebug Configuration

[Xdebug]

; Turn on auto-tracking

Xdebug.auto_trace = On

; Turn on exception tracking

Xdebug.show_exception_trace = On

; Turn on remote debugging auto-start

Xdebug.remote_autostart = On

; Turn on remote debugging

Xdebug.remote_enable = On

; Collecting variables

Xdebug.collect_vars = On

; Collect return values

Xdebug.collect_return = On

; Collect parameters

Xdebug.collect_params = On

Note the path behind the zend_extension_ts to fill in the absolute path, save and restart the server.

Now use Phpinfo () to view the PHP configuration, if the installation is successful, you should see the following information:

The following is the configuration of Eclipse

Detailed configuration please see the description (all images can be clicked to enlarge view)

Eclipse Global Overall Configuration: (Click to enlarge View)

  

Test server configuration: Click PHP Server in the window above .... After (click to enlarge View)

  

PHP Project overall configuration: After opening or creating a new PHP project, right-click on the project and select Properties (click to enlarge View)

     

According to the actual requirements of their configuration, the overall debugging environment is fully configured, start enjoy it!

Here's how to start debugging

1. First open the page you want to debug, I here to Emlog home index.php for example

In the Eclipse menu, select from the order in the image:

  

At this point eclipse will start the debug interface, the effect: (click to enlarge)

  

If your server is configured correctly, it will pop out of your browser and see the program page.

Now get into the focus, cool PHP breakpoint debugging feature

Right-click on the line where you want to set the breakpoint and select Toggle breakpoints

  

After Setup, please start debug again.

Here's an example (click to enlarge)

  

?

Someone will certainly ask, this is the homepage, if I want to debug the page with parameters or not directly access what to do?

The answer is simple, you just set a breakpoint on the page you want to debug, start any directly accessible page when you debug, and then click on the page you want to access from the page, or access the page that calls the file you want to debug, and eclipse will automatically jump out when you run to the breakpoint. Then you can start debugging.

This article is from the Web Development Network Source Link: http://www.cncms.com.cn/php/14008_3.htm

?

?

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