NotePad++ 使用 DBGp 調試php


1.使用phpinfo();查看php版本信息

 

2.配置xdebug

  2.1 根據php版本信息,下載對應的xdebug .

  

  2.2將下載的php_xdebug-2.1.2-5.3-vc6.dll文件放到php安裝目錄下面ext目錄中。

  

  2.3在php.ini中添加如下配置:

 

[xdebug]
zend_extension = "D:/LAMP/PHP535/ext/php_xdebug-2.1.2-5.3-vc6.dll"
xdebug.remote_enable=1
xdebug.remote_handler=dbgp
xdebug.remote_host=127.0.0.1
xdebug.remote_port=9000
xdebug.remote_mode=req
xdebug.idekey=xdebug
xdebug.remote_log="d:\temp\xdebug\xdebug.log"
xdebug.show_exception_trace=0
xdebug.show_local_vars=9
xdebug.show_mem_delta=0
xdebug.trace_format=0
xdebug.profiler_enable  = 1
xdebug.profiler_output_dir ="d:\temp\xdebug"

 

 2.4 重啟apache服務器,通過phpinfo();查看是否有xdebug相關輸出信息。 

 

3.配置DBGp插件

 3.1 下載最新版的DBGp插件 https://sourceforge.net/projects/npp-plugins/files/DBGP%20Plugin/

 

 3.2 將解壓得到的dll文件拷貝到 NotePad++安裝目錄下的plugins目錄里,然后重新打開NotePad++。

 

 3.3 在“插件”菜單欄下將會出現 DBGp子菜單,選擇config ,進入配置。

    

    

    IDE KEY 和 php.ini中的xdebug.idekey配置一樣。

 

   3.4 打開 插件->DBGp->Debugger

  

  點擊紅點,會在光標所在行添加斷點。 

 

   3.5 在要調試的頁面URL后添加 ?XDEBUG_SESSION_START=session_name 

   例如: http://localhost/test.php?XDEBUG_SESSION_START=abcd

  

 

 參考:http://thecancerus.com/debugging-php-using-xdebug-and-notepad-part-i/


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM