温馨提示×

温馨提示×

您好,登录后才能下订单哦!

密码登录×
登录注册×
其他方式登录
点击 登录注册 即表示同意《亿速云用户服务条款》

phpStorm配置xdebug远程调试

发布时间:2020-08-08 22:39:45 来源:网络 阅读:9687 作者:Captain_Dong 栏目:web开发

安装xdebug

  • 下载xdebug
    可到 xdebug官网 下载与自己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

    其他配置项见官网

配置phpstorm

  • 弹出设置窗口(file->settings or ctrl+alt+S)

phpStorm配置xdebug远程调试

  • 设置调试端口,需要与php.ini中的配置一致

phpStorm配置xdebug远程调试

  • 配置调试主机

phpStorm配置xdebug远程调试

phpStorm配置xdebug远程调试

phpStorm配置xdebug远程调试

  • 测试

phpStorm配置xdebug远程调试

向AI问一下细节

免责声明:本站发布的内容(图片、视频和文字)以原创、转载和分享为主,文章观点不代表本网站立场,如果涉及侵权请联系站长邮箱:is@yisu.com进行举报,并提供相关证据,一经查实,将立刻删除涉嫌侵权内容。

AI