PHPSTORM配置XDEBUG远程调试

时间:2023年06月24日

/

来源:网络

/

编辑:佚名

安装XDEBUG
下载xdebug
可到 xdebug网站 :https://xdebug.org/download下载与自己PHP版本对应的xdebug扩展
安装
[root] # cd /usr/local/src
[root] # tar zxvf xdebug-2.6.0RC2.tgz
[root] # cd xdebug-2.6.0RC2
[root] # /usr/local/php/bin/phpize
[root] # ./configure --enable-xdebug  --with-php-config=/usr/local/php/bin/php-config
[root] # make && make install
配置xdebug
修改php.ini配置文件,在文件中追加以下内容
zend_extension=xdebug.so //指定Xdebug扩展文件的路径
xdebug.remote_enable=1 //是否开启远程调试
xdebug.remote_handler=dbgp //指定远程调试的处理协议
xdebug.remote_mode=req //可以设为req或jit,req表示脚本一开始运行就连接远程客户端,jit表示脚本出错时才连接远程客户端。
xdebug.remote_host=192.168.1.98 //指定远程调试的主机名(安装phpstorm的主机ip)
xdebug.remote_port=9001 //指定远程调试的端口号
xdebug.idekey="PHPSTORM" //指定传递给DBGp调试器处理程序的IDE Key
其他配置项见网站:https://xdebug.org/docs/all_settings
配置PHPSTORM
弹出设置窗口(file->settings or ctrl+alt+S)

phpStorm配置xdebug远程调试
设置调试端口,需要与php.ini中的配置一致

phpStorm配置xdebug远程调试
配置调试主机



测试

phpStorm配置xdebug远程调试
猜你需要

豫ICP备2021026617号-1  豫公网安备:41172602000185   Copyright © 2021-2028 www.78moban.com/ All Rights Reserved

本站作品均来自互联网,转载目的在于传递更多信息,并不代表本站赞同其观点和对其真实性负责。如有侵犯您的版权,请联系 1565229909#qq.com(把#改成@),我们将立即处理。