Zend Studio 調試Zend Debugger和XDebug

安裝Zend Debugger

下載

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

下載後將zip解壓縮。得到一個目錄:有x_x_x_compx_x_x_nts_compx指版本號,phpinfo查看php版本和thread safe屬性,

配置

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

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

[Zend]

zend_extension_ts=C:/wamp/bin/php/php5.xxx/ZendDebugger.dll

;zend_extension=C:/wamp/bin/php/php5.xxx/ZendDebugger.dll


;也可以在ZEND STUDIO window -- preferences -- PHP server中設置;

;同時到Project -- propertites中設置 PHP Debug Server Setting 中選擇已創建的SERVER

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是否成功

 


 

問題: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 php5.4之前中加入

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

php5.4之後改用

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

然後重啓apache通過phpinfo()輸出並查找xdebug是否被成功加載。

問題:XDebug無法進入斷點

php.ini中加入

;開啓自動跟蹤

xdebug.auto_trace = On

;開啓異常跟蹤

xdebug.show_exception_trace = On

;開啓遠程調試自動啓動,所有PHP訪問將自啓動調試

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:/php7/temp"

xdebug.profiler_enable=On

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

 

;可選項,也可在Zend studio / window /preperences / Server 設置

xdebug.remote_host=localhost  ;設置 localhost

xdebug.remote_port=9000       ;設置默認9000,只要端口未被使用

xdebug.remote_handler=dbgp

 重啓apache



Zend Studio v13 添加 調試服務器

Window-Preferences-PHP-Servers










--- 調試 ---

如果之前調試過某個文件,先切換到Debug視圖,刪除相應的調試記錄,切換回Recource視圖,

右鍵點擊要調試的文檔,debug as , 修改url,如使用urlrewrite 則填入正確的地址提交






發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章