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远程调试
下载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远程调试
新闻资讯 更多
- 【建站知识】查询nginx日志状态码大于400的请求并打印整行04-03
- 【建站知识】Python中的logger和handler到底是个什么?04-03
- 【建站知识】python3拉勾网爬虫之(您操作太频繁,请稍后访问)04-03
- 【建站知识】xpath 获取meta里的keywords及description的方法04-03
- 【建站知识】python向上取整以50为界04-03
- 【建站知识】scrapy xpath遇见乱码解决04-03
- 【建站知识】scrapy爬取后中文乱码,解决word转为html 时cp1252编码问题04-03
- 【建站知识】scrapy采集—爬取中文乱码,gb2312转为utf-804-03