到http://downloads.zend.com/pdt/server-debugger下載最新的debugger
1、請將ZendDebugger.dll復(fù)制到您的php安裝目錄下,比如:你的php根目錄/ext/
2、然后將下面的4行內(nèi)容加到您的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是遠程調(diào)試的文件所在機器的IP;我是本地web調(diào)試
3、將dummy.php復(fù)制到apache的document root目錄。
4、重啟apache。
5.到Zend Studio的Tools->preferences->debug下核對一下設(shè)置是正確的
6.測試Debugger是否成功
“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.
到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是否被成功加載。
在php.ini中加入
;開啟自動跟蹤 | |
xdebug.auto_trace = On |
;開啟異常跟蹤 | |
xdebug.show_exception_trace = On |
;開啟遠程調(diào)試自動啟動 | |
xdebug.remote_autostart = On |
;開啟遠程調(diào)試 | |
xdebug.remote_enable = On |
;收集變量 | |
xdebug.collect_vars = On |
;收集返回值 | |
xdebug.collect_return = On |
;收集參數(shù) | |
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