Use Eclipse + PDT + Zend Debugger to develop PHP (old version)

本文详细介绍了如何使用 Eclipse PDT 进行 PHP 代码调试。包括安装 Apache 和 PHP,配置 Eclipse PDT 和 Zend Debugger,以及在 Eclipse 中创建和调试 PHP 项目的过程。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

This is old version article. Pls refer to new article: http://blog.youkuaiyun.com/totogogo/archive/2010/01/06/5144987.aspx

 

 

Install

1. Install apache and php

 

2. Download eclipse + PDT + zend debugger all in one from http://www.zend.com/en/community/pdt

 

3. Check the setting in "Preferences -> PHP", such as PHP Servers, PHP Manual and Debug Node, 通常缺省的已经 OK (If web server port is not 80, you need to modify the PHP Server setting.)

 

 

4. Configure Zend Debugger into PHP 这步重要,否则你在 debug 你的 php web page 时不会 stop at the breakpoint :

    1) Search file “ ZendDebugger.dll ” in the eclipse (PDT) folder, you can see 2 files, copy the one in “ php5 ” folder to PHP_INSTALL_DIR/ext folder

 

    2) copy following lines to “ php.ini ” file

zend_extension_ts=E:/develop/php/php5.2.6/ext/ZendDebugger.dll

zend_debugger.allow_hosts=127.0.0.1

zend_debugger.expose_remotely=always

 

 

 

Create + Run + Debug PHP in eclipse

1. Create a php project

 

 

 

2. Create php file

 

3. Two types of running & debugging php

     1) right click the php file, select “Run/Debug As -> PHP Script

     2) right click the php file, select “Run/Debug As -> PHP Web Page

 

 

 

If you run/debug php file as PHP web page first time, a window popup and ask you comfirm the URL.

 

If you set break point in the php file and Debug it, it will switch to debug perspective and stop on the break point.

 

 

Reference links:

https://www6.software.ibm.com/developerworks/education/os-php-eclipse-pdt-debug/section4.html

http://hi.baidu.com/momoca/blog/item/4600b600cd85e684e950cdd0.html

 

 

 

 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值