ECLIPSE/PDT xdebug Debugging PHP

Source: Internet
Author: User
Tags php file root directory zend

Software:

XAMPP 1.6.6 uncompressed version.

PDT 1.0.2 release All-in-one.

XDebug 2.0.2 | Windows modules PHP 5.2.1-5.2.7.

Note that the version of Xdebug must be compatible with the PHP version in XAMPP, XAMPP 1.6.6 PHP version is 5.2.5, so use Xdebug 2.0.2 | Windows Modules PHP 5.2.1-5.2.7

Installation:

Install XAMPP

Unzip the XAMPP, run the Setup_xampp.bat under the root directory for installation

Run Xampp_start.exe boot server, enter http://localhost in browser to test

Run Xampp_stop.exe shutdown server

Install Xdebug

Rename the downloaded Php_xdebug-2.0.2-5.2.5.dll to Php_xdebug.dll and copy it to the xampp\php\ext\ directory

Modify the Xampp\apache\bin\php.ini file, find the [Zend] code snippet, and use all of the code snippet ";" Comment out, find the [XDebug] code snippet, and Zend_extension_ts,xdebug.remote_enable,xdebug.remote_host,xdebug.remote_port,xdebug.remote_ Handler front of the ";" annotation character removed

Run Xampp_start.exe start the server, enter http://localhost/xampp/phpinfo.php in the browser, find the string xdebug, if you can find it, the installation is successful.

Why should I comment out [Zend] code snippets? Because the Zend Optimizer and Xdebug 2.0.2 are incompatible, the XAMPP startup failure is caused.

Install PDT

Unzip Pdt-all-in-one-r20080103-win32.zip, run Eclipse.exe start PDT (Note: Because Eclipse is Java-written, you need to install the JRE first)

Configure Xdebug to be used in PDT to create a new debug.php file, as follows:

<?php
function add ($a, $b) {
$result = $a + $b;
return $result;
}
echo Add (4, 5);
?>

Related Article

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.