Eclipse quickly builds PHP debugging environment

Source: Internet
Author: User
Tags phpinfo zend

Eclipse quickly builds PHP debugging environment

On the Internet to read a lot about the creation of PHP debugging environment of the article, I tried a turn, but did not succeed, and then their own to Zend official to see, the original version of the problem. Complete configuration steps are now available. I hope beginners can build up the environment quickly, Focus on the code rather than on the configuration. If you have not yet configured the success, you can also click on video 1 video 2 here to view Flash video.

My environment is as follows: Windows-xp+wamp (Windos Apache Mysql PHP integrated installation Environment ) or XAMPP (similar to Wamp).

1. Preparatory work
    • Download wamp5_1.7 from the web, or xampp-win32-1.6.5, refer to address: http://www.codepub.com/d/downpage.php?n=1&id=7656::1162764159 http ://www.apachefriends.org/zh_cn/xampp-windows.html#1787 installation process is very simple, wamp only need to take the next step, and XAMPP needs to extract to the root of the drive letter, otherwise it will not start.
    • Download to Zend's website
      Zenddebugger:http://downloads.zend.com/pdt/server-debugger/zenddebugger-5.2.12-cygwin_nt-i386.zip
      Eclipse:http://downloads-source.zend.com/pdt/all-in-one/pdt-1.0.2.r20080103_debugger-5.2.12.v20071210-all-in-one-win32.zip

      It is best to have the above version, otherwise debugging may cause errors.
2.Zend Debugger Install (compile), take xamp as an example, wamp similar
    • Copy the ZendDebugger.dll xampp PHP directory, launch XAMPP, open the following address: http://localhost/xampp/phpinfo.php View the address of the php.ini file, such as:

Open the php.ini file in the following section:
[Zend]
Zend_extension_ts = "E:/xampp/php/zendoptimizer/lib/zendextensionmanager.dll"
Zend_extension_manager.optimizer_ts = "E:/xampp/php/zendoptimizer/lib/optimizer"
; zend_optimizer.enable_loader = 0
; zend_optimizer.optimization_level=15
; Zend_optimizer.license_path =
; Local Variables:
; tab-width:4
; End:

Replace with (note: The value of zend_debugger.allow_hosts changes to your corresponding IP address):
[Zend]
Zend_extension_ts= "E:/xampp/php/zenddebugger.dll"
Zend_debugger.allow_hosts=127.0.0.1/32,192.168.0.0/24
Zend_debugger.expose_remotely=always

Restart Xampp, and then open http://localhost/xampp/phpinfo.php to see if the following appears:

If it appears, the Zend Debugger is enabled successfully, and if not, verify that the path to the DLL file is correct.

3.eclipse Installation and Configuration
    • Unzip the eclipse you just downloaded to any directory and run Eclipse.exe directly.
    • In the Eclipse menu bar Select Window/preference, then choose Php/debug, point php excuteables, link, click Add to add the PHP path under the XAMPP is added recently, such as:


      When turned off, open Window/prference/php/debug again, set as:


      Finally, apply and OK buttons. This completes the installation configuration of Eclipse!

4. Debugging PHP Programs

After the installation of the above configuration, the PHP program can be like Java for complex debugging, such as Breakpoint debugging. Start by creating a new PHP project.
Create a new PHP file:

<?php
mysql_connect ("localhost", "root", "") or
Die ("Could Not connect:". Mysql_error ());
mysql_select_db ("MySQL");

$result = mysql_query ("Select help_keyword_id, name from Help_keyword");

while ($row = Mysql_fetch_array ($result, Mysql_both)) {
printf ("ID:%s Name:%s", $row [0], $row [1]);
}

Mysql_free_result ($result);
?>

After saving, right click, select Debug As/open debug Dialog, double-click PHP script, such as:

Click Apply, then debug, pop Up a dialog box, say whether to enter the debug mode, click Yes, you can debug, such as:

Finally congratulations on your installation of the configuration is successful! Make your level more elevated!

Eclipse quickly builds PHP debugging environment

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.