Home > Backend Development > PHP Tutorial > A brief discussion on Eclipse PDT debugging PHP programs_PHP tutorial

A brief discussion on Eclipse PDT debugging PHP programs_PHP tutorial

WBOY
Release: 2016-07-13 10:28:45
Original
1036 people have browsed it

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:

Copy code The code is as follows:

[xdebug]
zend_extension="/usr/lib/php5/20090626+ lfs/xdebug.so"
xdebug.remote_handler=dbgp
xdebug.remote_port=9000
xdebug.auto_trace=on
xdebug.collect_params=on
xdebug.collect_return=on
xdebug .max_nesring_level=100
xdebug.profile_enable=on
xdebug.remote_enable=on
xdebug.remote_host=localhost
xdebug.trace_output_dir="/tmp"
xdebug.profile_output_dir="/tmp"
xdebug.idekey=webide
xdebug.mode=req

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.

www.bkjia.comtruehttp: //www.bkjia.com/PHPjc/781031.htmlTechArticle1. Download eclipse, just find it from the official website, and confirm that there is a java environment in the current system, that is, jdk andjre. 2. Installed pdt, using online installation, the update address is already included in the default...
Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template