phpStorm配置xdebug远程调试

安装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远程调试

转载于:https://blog.51cto.com/13660331/2093885

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值