phpstorm + xdebug 本地和远程服务器的使用

Linux之Xdebug安装:

1.安装xdebug

# wget http://xdebug.org/files/xdebug-2.6.1.tgz
# tar -xvzf xdebug-2.6.1.tgz
# cd xdebug-2.6.1
# /usr/bin/phpize //使用 which phpize 查找
# ./configure --with-php-config=/usr/local/php/bin/php-config
# make
# cp modules/xdebug.so /usr/local/php/lib/php/extensions/no-debug-non-zts-20170718
# vim /usr/local/php/etc/php.ini
新增配置参数:
[xdebug]
zend_extension = /usr/local/php/lib/php/extensions/no-debug-non-zts-20170718/xdebug.so
xdebug.remote_enable=1
xdebug.remote_handler=dbgp
xdebug.remote_mode=req
xdebug.remote_host=192.168.119.54  //本机内网IP,参考下图
xdebug.remote_port=9009 //不被使用就行
xdebug.idekey=PHPSTORM
# 重启php-fpm
# 查看phpinfo()是否存在Xdebug扩展

2. 安装xdebug [ Ubuntu16.04 ]  

sudo apt-get install php-xdebug

xdebug位置: /etc/php/7.0/mods-available/xdebug.ini

更改为:

zend_extension=xdebug.so
xdebug.idekey=PHPSTORM
xdebug.remote_connect_back = 1
;//如果开启此,将忽略下面的 xdebug.remote_host 的参数
 
;xdebug.remote_host=192.168.x.x
; //注意这里是,客户端的ip<即IDE的机器的ip,不是你的web server>
 
xdebug.remote_enable=on
xdebug.remote_port = 9001
;//注意这里是,客户端的端口<即IDE的机器的ip,不是你的web server>
 
xdebug.remote_handler = dbgp
xdebug.auto_trace = 1
xdebug.remote_log = /tmp/xdebug.log

3 PHPstorm配置:

https://blog.csdn.net/supramolecular/article/details/81125793

https://blog.csdn.net/hp_8023_wm/article/details/79268734

https://blog.csdn.net/qq_29627497/article/details/82049610

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

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值