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!