惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

月光博客
月光博客
罗磊的独立博客
The GitHub Blog
The GitHub Blog
V
V2EX
Last Week in AI
Last Week in AI
博客园 - 聂微东
MyScale Blog
MyScale Blog
美团技术团队
L
LangChain Blog
博客园 - Franky
腾讯CDC
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
博客园_首页
S
SegmentFault 最新的问题
爱范儿
爱范儿
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
Stack Overflow Blog
Stack Overflow Blog
量子位
小众软件
小众软件
宝玉的分享
宝玉的分享
J
Java Code Geeks
Google DeepMind News
Google DeepMind News
D
Docker
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报

博客园 - yaksea

APScheduler: standalone vs daemonic 一句话解释jquery中offset、pageX, pageY、position、scrollTop, scrollLeft的区别 mongodb正则查询使用须知 PhoneGap源代码下载地址 python mysql 库的安装 windows环境下PYTHONPATH的设置 Eclipse+pydev2.2+python2.7 中文乱码问题 雷军:互联网创业的葵花宝典 什么是node.js 对python元类概念的理解 设置Django,在Eclipse+PyDev环境中开发Django应用 Python的模块、包等概念的理解 Python下划线与命名规范 Django如何进行数据访问查询 Django IDE 开发环境的搭建 在Eclipse下如何安装插件 使用Django如无到有11步快速构建Web应用 如何使用blog客户端 Apache如何添加虚拟目录
Zend Studio下的PHP代码调试
yaksea · 2011-08-26 · via 博客园 - yaksea

问题:Zend Studio无法调试php代码

安装Zend Debugger

下载

http://downloads.zend.com/pdt/server-debugger下载最新的debugger

下载后将zip解压缩。得到一个目录:有x_x_x_compx_x_x_nts_compx指版本号,ntsnon thread safe,使用phpinfo查看你的php安装版本和thread safe属性,

配置

1、请将ZendDebugger.dll复制到您的php安装目录下,比如:你的php根目录/ext/

2、然后将下面的4行内容加到您的php.ini

[Zend]

zend_extension_ts=C:/wamp/bin/php/php5.2.9-2/ZendDebugger.dll

;此处ts代理线程安全

zend_debugger.allow_hosts=127.0.0.1

zend_debugger.expose_remotely=always

其中,127.0.0.1是远程调试的文件所在机器的IP;我是本地web调试

3、将dummy.php复制到apachedocument root目录。

4、重启apache

5.Zend StudioTools->preferences->debug下核对一下设置是正确的

6.测试Debugger是否成功

clip_image002[4]

问题:Test Debugger报错

clip_image004[4]

“A timeout occurred when the debug server attempter to connect to the following client hosts/IPS”

所以注意了:如果你的php版本是5.3以上,且是thread safe的,那么不要浪费你的时间做尝试,建议你直接改用XDebug吧。以下官方给出的解释。

The Debugger we provide supports only the non-thread-safe architecture, that is why it does not load in your configuration.
Zend stopped supporting the thread safe architecture when Microsoft also decided to implement its PHP engine with the fast-cgi architecture which means non-thread-safe.
Best regards,
Massi.

任务:XDebug安装

http://xdebug.org/download.php选择自己需要的xdebug版本。

下载并解压到自己需要的位置。

php.ini中加入

zend_extension_ts="你的php根目录/ext/php_xdebug.dll"

如果不行改用

zend_extension="你的php根目录/ext/php_xdebug.dll"

然后重启apache通过phpinfo()输出并查找xdebug是否被成功加载。

问题:XDebug无法进入断点

php.ini中加入

;开启自动跟踪

xdebug.auto_trace = On

;开启异常跟踪

xdebug.show_exception_trace = On

;开启远程调试自动启动

xdebug.remote_autostart = On

;开启远程调试

xdebug.remote_enable = On

;收集变量

xdebug.collect_vars = On

;收集返回值

xdebug.collect_return = On

;收集参数

xdebug.collect_params = On

xdebug.trace_output_dir="e:/xampp/temp"

xdebug.profiler_enable=On

xdebug.profiler_output_dir=" e:/xampp/temp"

 

xdebug.remote_host=localhost

xdebug.remote_port=9000

xdebug.remote_handler=dbgp

最后,记得重启apache