Eclipse + PDT + Xdebug remote debugging of apache + php projects on Linux Hosts

Source: Internet
Author: User

This article describes how to remotely debug the apache + php project on a Linux host. The tools required by each client are as follows:

CLIENT (windows, 10.239.54.24) ----------------------------------------------------------------- SERVER (ubuntu 10.04, 10.239.54.115)

Browser with xdebug plugin xdebug

Eclipse with PDT


Environment installation:

1. Eclipse juno 4.2

2. PDT (Eclipse-> Help-> Install New Software (Juno-http://download.eclipse.org/releases/juno)-> Programming Languages-> PHP Development Tools (PDT) SDK feature)

3. Xdebug

CLIENT browser plug-in Installation
SERVER Side xdebug installation: sudo apt-get install php5-xdebug

Environment Configuration:

1. SERVER:

Make sure that/etc/php5/apache2/php. ini contains the following configuration

[Xdebug]
Zend_extension = "/usr/lib/php5/20090626 + lfs/xdebug. so"
Xdebug. remote_enable = On
Xdebug. remote_host = $ clientIP such as "10.239.54.24"
Xdebug. remote_port = 9000
Xdebug. remote_handler = "dbgp"
...

2. CLIETNT:

1) Eclipse configuration is as follows:

Eclipse-> Window-> Preferences-> General-> Web Browser-> Use external web browser-> Chrome

Eclipse-> Window-> Preferences-> PHP-> Debug-> PHP Debuger-> Xdebug (Zend Debugger by default)

2) The project Debug configuration is as follows:

Assume that the homepage of test_debug is index. php.

Use Eclipse to open index. php. In the menu bar Run-> Debug deployments, a box with Server and Debugger will pop up.

Server tab-> New, fill in Name, Base URL (such as http: // 10.239.54.115), Local Web Root (browse to test_debug project directory), and then finish

Return to the server Tab. There is URL information corresponding to the index of the project on the SERVER. php. The "Auto Generate" check box is selected by default. The URL value may be http: // 10.239.54.115 +/test_debug/index. php. If not, correct the modification. If this step is incorrect, chrome will report errors such as page not found during debugging. If you want to add parameters, add them to the URL.

After the above process, you can set a breakpoint and click F11. chrome will automatically open it and work with your eclipse configuration. So, start debugging!

 

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.