1. 程式人生 > >phpstorm+Xdebug斷點調試PHP

phpstorm+Xdebug斷點調試PHP

dst ref zend pin x64 其他 dll 斷點調試 第一個

運行環境:

PHPSTORM版本 : 8.0.1

PHP版本 : 5.6.2

xdebug版本:php_xdebug-2.2.5-5.6-vc11-x86_64.dll

ps : php版本和xdebug版本一定要相對應

1. PHP安裝xdebug擴展

php.ini的配置,下面的配置僅供參考,路徑要換成自己的!

[xdebug]

zend_extension="D:\wamp\php-5.6.2-x64\ext\php_xdebug-2.2.5-5.6-vc11-x86_64.dll"

xdebug.remote_enable = On

xdebug.remote_handler = dbgp

xdebug.remote_host= localhost

xdebug.remote_port = 9000

xdebug.idekey = PHPSTORM

ps : remote_handler 、remote_host、remote_port 這些都有默認值,但還是建議設置下,至少知道要設置這些參數~

查看phpinfo~

技術分享

2.PHPSTORM設置

樓主以前一直用zendstudio,剛開始用phpstorm非常蛋疼,用了一段時間後發現還挺好用的~

1.首先檢查phpstorm的xdebug配置

這裏的debug port要和php.ini裏面的xdebug.remote_port相一致!默認是9000,如果9000端口被占用的話,可以改成其他端口。

技術分享

技術分享

2. 設置debug.

技術分享

技術分享

添加本地的 web server~

www.51open.pcom 是我本地的 web server~ ~

技術分享

技術分享

技術分享

3.開始調試

  1. 打好第一個斷點,shift + F9就可以了

  2. 打好第一個斷點,選中配置的debug, 按旁邊的臭蟲 按鈕

技術分享



phpstorm+Xdebug斷點調試PHP