我是靠谱客的博主 体贴路灯,最近开发中收集的这篇文章主要介绍服务器端调试PHP程序,觉得挺不错的,现在分享给大家,希望可以做个参考。

概述

最近在一个Mantis定制项目, 因为习惯, 打算配一个Eclipse插件作为IDE,调查了一下,发现Zend公司支持了一个PDT(Php Development tools)项目.

 

下载了一下发现果然很不错, Debug器内置两种模式, 一种是本地Php页面调试, 一种是远程Server调试.

前一种情况,使用内置的php解释脚本, 方法上与Java一样,

这里就话不多说, 主要说一下服务器端的php调试配置方法, 以windows上Apache为例.

 

以下是PDT里面关于这一部分的帮助

写道
PDT User Guide > PDT Help > Tasks > Using the Debugger
Setting Up Remote Debugging


Before debugging on a server using PHP Web Page debugging, certain settings need to be configured to ensure that PDT can communicate with your server.

Note: The following instructions explain how to set up Remote Debugging with the Zend Debugger.

To set up communication between Studio and the server on which you are debugging:

1. Ensure the Zend Debugger is installed on your server.
The Zend Debugger comes bundled with Zend Core and Zend Platform, but can also be downloaded as a separate component from http://www.zend.com/en/products/studio/downloads

2. Ensure the machine on which your PDT is installed is an allowed host for your debugger.
See Setting your PDT to be an Allowed Host for more information.

3. In PDT, configure your server according to the instructions under Adding Servers in the PHP Servers Preferences.

4. Ensure the correct settings are configured in your Debug Preferences and Installed Debuggers Preferences pages.

5. Ensure you have a dummy.php file in your remote server's document root.

 

原来,要想调试服务器端的程序, 需要额外配置Debug模块, 于是按照上面的链接,下载相应的Zend debugger组件即可.

另: 上面的链接需要注册Zend ID, 所以Windows用户,也可使用下面链接直接下载.

windows版的Zend Debugger

 

下载之后Readme文件中有下面信息:

写道
1. Locate ZendDebugger.so or ZendDebugger.dll file that is compiled for the
correct version of PHP (4.3.x, 4.4.x, 5.0.x, 5.1.x, 5.2.x) in the
appropriate directory.

2. Add the following line to the php.ini file:
Linux and Mac OS X: zend_extension=/full/path/to/ZendDebugger.so
Windows: zend_extension_ts=/full/path/to/ZendDebugger.dll
Windows non-tread safe: zend_extension=/full/path/to/ZendDebugger.dll

(*) the windows non-thread safe is used only with Zend Core 2.0

3. Add the following lines to the php.ini file:
zend_debugger.allow_hosts=<ip_addresses>
zend_debugger.expose_remotely=always

4. Place dummy.php file in the document root directory.

5. Restart web server.

 

至此, 一切搞定. 另PHP也可以使用dbg等其他测试模块

 

最后转载几个相应链接

使用 Eclipse 和 PDT 调试 PHP

7 种流行 PHP IDE 的比较

最后

以上就是体贴路灯为你收集整理的服务器端调试PHP程序的全部内容,希望文章能够帮你解决服务器端调试PHP程序所遇到的程序开发问题。

如果觉得靠谱客网站的内容还不错,欢迎将靠谱客网站推荐给程序员好友。

本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
点赞(60)

评论列表共有 0 条评论

立即
投稿
返回
顶部