Zend Studio下的PHP代碼調試

問題:Zend Studio沒法調試php代碼

安裝Zend Debugger

下載

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

下載後將zip解壓縮。獲得一個目錄:有x_x_x_compx_x_x_nts_compx指版本號,ntsnon thread safe,使用phpinfo查看你的php安裝版本和thread safe屬性,

配置

1、請將ZendDebugger.dll複製到您的php安裝目錄下,好比:你的php根目錄/ext/web

2、而後將下面的4行內容加到您的php.iniapache

[Zend]安全

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

;此處ts代理線程安全測試

zend_debugger.allow_hosts=127.0.0.1spa

zend_debugger.expose_remotely=always線程

其中,127.0.0.1是遠程調試的文件所在機器的IP;我是本地web調試debug

3、將dummy.php複製到apachedocument root目錄。代理

4、重啓apache

5.Zend StudioTools->preferences->debug下覈對一下設置是正確的

6.測試Debugger是否成功

 

 

 

問題:Test 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.

 

 

任務: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

相關文章
相關標籤/搜索