1. Download eclipse, just find it from the official website, and confirm that there is a java environment in the current system, that is, jdk and jre.
2. Pdt is installed, using online installation, and the update address is already included by default. It's just more troublesome to update. (If you directly download the Eclipse version with PDT, you can omit it)
3. Download the debugger. There are two debuggers, one is xdebug and the other is zenddebug. This article uses xdebug.
What you download should be the source code package. Unzip it, then cd to the directory, and then phpize. Sometimes this program may not be available, just run sudo apt-get install php5-dev and it will be fine. Then the familiar config program ./configure will appear. A series of black and white screen characters will appear, followed by make and make install. When the latter two commands are executed, sudo permissions may be required because they involve copying program files to the system directory.
4. Create an xdebug.ini file in /etc/php5/apache2/conf.d/. You can use vi or other text programs and add the following configuration items. The configuration content is as follows:
The ini file placed in this directory will be automatically loaded by php.
At this point, the installation and configuration of xdebug has been completed.
5. Open eclipse, then select window preference, first configure the service options:
Configure debug first, select php, select debug, and select php’s debugger as xDebug. Then configure the Server,
select PHP Servers, and then pop up the menu: Then click new, select a name at Name, and configure the url to be the main url for debugging.
Then set it to default.
Finally configure PHP Executables, add a random name, set the path to /usr/bin/php and then set the location of the ini to /etc/php5/apache2/php.ini
SAPI Type should be set to CGI, but I can't seem to adjust, I don't know why.
Finally, set the PHP debugger to XDebug.
6. Everything is ready, create a new php project, these must be found in your apache, then create a new php page, write a piece of code, add a few breakpoints, then right-click the php page and select debug as phpscript You can see the familiar debugging window, including the variable list, post, get values, etc.