设为首页 收藏本站
查看: 1807|回复: 0

[经验分享] 服务器端调试PHP程序

[复制链接]

尚未签到

发表于 2017-3-29 11:44:04 | 显示全部楼层 |阅读模式
  最近在一个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 Debuggeris installed on your server.
The Zend Debugger comes bundled with Zend Core and Zend Platform, but can also be downloaded as a separate component fromhttp://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 的比较

运维网声明 1、欢迎大家加入本站运维交流群:群②:261659950 群⑤:202807635 群⑦870801961 群⑧679858003
2、本站所有主题由该帖子作者发表,该帖子作者与运维网享有帖子相关版权
3、所有作品的著作权均归原作者享有,请您和我们一样尊重他人的著作权等合法权益。如果您对作品感到满意,请购买正版
4、禁止制作、复制、发布和传播具有反动、淫秽、色情、暴力、凶杀等内容的信息,一经发现立即删除。若您因此触犯法律,一切后果自负,我们对此不承担任何责任
5、所有资源均系网友上传或者通过网络收集,我们仅提供一个展示、介绍、观摩学习的平台,我们不对其内容的准确性、可靠性、正当性、安全性、合法性等负责,亦不承担任何法律责任
6、所有作品仅供您个人学习、研究或欣赏,不得用于商业或者其他用途,否则,一切后果均由您自己承担,我们对此不承担任何法律责任
7、如涉及侵犯版权等问题,请您及时通知我们,我们将立即采取措施予以解决
8、联系人Email:admin@iyunv.com 网址:www.yunweiku.com

所有资源均系网友上传或者通过网络收集,我们仅提供一个展示、介绍、观摩学习的平台,我们不对其承担任何法律责任,如涉及侵犯版权等问题,请您及时通知我们,我们将立即处理,联系人Email:kefu@iyunv.com,QQ:1061981298 本贴地址:https://www.yunweiku.com/thread-357027-1-1.html 上篇帖子: PHP的安装,开发环境的搭建 下篇帖子: 使用php实现伪静态化页面
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

扫码加入运维网微信交流群X

扫码加入运维网微信交流群

扫描二维码加入运维网微信交流群,最新一手资源尽在官方微信交流群!快快加入我们吧...

扫描微信二维码查看详情

客服E-mail:kefu@iyunv.com 客服QQ:1061981298


QQ群⑦:运维网交流群⑦ QQ群⑧:运维网交流群⑧ k8s群:运维网kubernetes交流群


提醒:禁止发布任何违反国家法律、法规的言论与图片等内容;本站内容均来自个人观点与网络等信息,非本站认同之观点.


本站大部分资源是网友从网上搜集分享而来,其版权均归原作者及其网站所有,我们尊重他人的合法权益,如有内容侵犯您的合法权益,请及时与我们联系进行核实删除!



合作伙伴: 青云cloud

快速回复 返回顶部 返回列表