環(huán)境:Windows +Xampp + PHPStorm
一 、安裝Xdebug
訪問Xdebug官網(wǎng)
直接將 phpinfo() 信息輸出并復制到上面的文本框中,然后按照指示操作即可。
二、配置PHP.ini
在php.ini底部添加以下代碼并重啟
zend_extension = D:\xampp\php\ext\php_xdebug-2.9.6-7.2-vc15-x86_64.dll
xdebug.max_nesting_level=100;
xdebug.overload_var_dump = On
xdebug.collect_return=on
xdebug.auto_trace = Off
xdebug.show_exception_trace = Off
xdebug.remote_autostart = On;
xdebug.remote_enable = On
xdebug.collect_vars = On
xdebug.collect_return = On
xdebug.collect_params = On
xdebug.profiler_enable = Off
xdebug.remote_host=localhost
xdebug.remote_port=9000;
xdebug.idekey=PHPSTORM
三、配置PHPStrom
1- Settings -> Languages & Frameworks -> PHP 中設置 PHP language level 和 CLI Interpreter

2- Settings -> Languages & Frameworks -> PHP -> Debug中,確保Debug port與php.ini中xdebug.remote_port一致

3-?Settings -> Languages & Frameworks -> PHP -> Servers 添加一個服務器

4- PHPStorm右上角,Edit Configurations 添加 PHP Web Page


這樣就可以使用debug斷點調(diào)試功能了。