zend studio結合xdebug、xdebug-help(chrome插件)調試PHP程序

zend studio結合xdebug、xdebug-help(chrome插件)調試PHP程序

  1、原料:php

    zend studio (我用的是11.0.2)chrome

    xdebug(版本要與服務器的PHP環境一致)windows

    xdebug-helper(chrome插件,chrome插件擴展已封,能夠到網上下載離線版,而後安裝)服務器

  2、安裝:eclipse

    2.一、安裝xdebug      函數

      1)、找到與PHP環境對應的xdebug組件,而後放置到ext目錄下spa

      2)、修改php.ini文件。.net

      修改範例:插件

          注意:具體的PHP環境、插件位置等 要根據本身的真實環境來配置debug

      

[Xdebug] ;xdebug配置
zend_extension="D:/Program Files/PHP/php-5.4.30-Win32-VC9-x86/ext/php_xdebug-2.2.3-5.4-vc9.dll" ;載入Xdebug
xdebug.profiler_enable=on
xdebug.trace_output_dir="D:/Program Files/PHP/php-5.4.30-Win32-VC9-x86/ext/xdebug-log" ;xdebug 的數據文件目錄
xdebug.profiler_output_dir="D:/Program Files/PHP/php-5.4.30-Win32-VC9-x86/ext/xdebug-log" ;xdebug 的數據文件目錄
xdebug.auto_trace = On ;開啓自動跟蹤
xdebug.show_exception_trace = On ;開啓異常跟蹤
xdebug.remote_autostart = Off ;開啓遠程調試自動啓動
xdebug.remote_enable = On ;開啓遠程調試
xdebug.remote_handler=dbgp ;用於zend studio遠程調試的應用層通訊協議
xdebug.remote_host=localhost ;容許鏈接的zend studio的IP地址
xdebug.remote_port=9000 ;反向鏈接zend studio使用的端口
xdebug.collect_vars = On ;收集變量
xdebug.collect_return = On ;收集返回值
xdebug.collect_params = On ;收集參數
xdebugbug.max_nesting_level = 10000 ;若是設得過小,函數中有遞歸調用自身次數太多時會報超過最大嵌套數錯

      3)、訪問phpinfo(),查看安裝是否完成!

    2.二、安裝xdebug-helper

      注意:因爲chrome擴展程序被封,此文只講如何安裝離線版的

      1)、下載離線版xdebug-helper

         網址:http://download.csdn.net/detail/yunmeng12/8169251

       2)、直接打開chrome擴展界面,如圖

        

      3)、而後將離線組件拖放到該位置便可安裝了!

       4)、安裝完配置,指到eclipse便可!如圖:

        

      5)、開啓調試模式

           

    2.三、配置zend studio

      1)、開啓xdebug監控

        windows->preferences->PHP->Debug->Installed Debuggers,選中編輯XDebug那一欄,修改Accept Remote Session(JIT)爲 localhost或 any 便可!

        如圖所示:

                            

                  

                          

      在zend studio裏打開斷點便可!

                    

      打上斷點便可輕鬆調試了!

  3、總結:

    至此已經徹底完成PHP調試的準備工做了,能夠爲所欲爲的調試debug了,是否是很爽!若是還有不明白的,能夠留言與筆者交流!

 

相關文章
相關標籤/搜索