總體分爲三步:
2 1.配置本地php.ini文件
在php.ini中添加Xdebug配置
[Xdebug]
zend_extension=C:/d/phpstudy_pro/Extensions/php/php7.3.4nts/ext/php_xdebug.dll
xdebug.remote_enable=On
xdebug.remote_host=localhost
xdebug.remote_port=9000
xdebug.collect_params=1
xdebug.collect_return=1
xdebug.auto_trace=On
xdebug.trace_output_dir=C:/d/phpstudy_pro/Extensions/php_log/php7.3.4nts.xdebug.trace
xdebug.profiler_enable=On
xdebug.profiler_output_dir=C:/d/phpstudy_pro/Extensions/php_log/php7.3.4nts.xdebug.profiler
xdebug.remote_handler=dbgp
然後用php -v 命令看一下,如下圖就算配置成功了
2.修改IDE配置
端口配置和php.ini中 xdebug.remote_port=9000一致
這裏主要是配置一個key,端口隨意添一個也能用。。。。
配置域名和網站的端口
###右上角打開監聽 ,變成下圖這樣就可以了
3.安裝chrome瀏覽器插件
其實不裝插件也可以,主要是爲了在cookie中生成一個值,和IDE能對上,如下圖
在程序里加上斷點
如果你沒有裝插件的,就這樣玩吧
http://網站地址??XDEBUG_SESSION_START=PHPSTORM
cookie就會自動添加key