ubuntu安装phpstorm+xdebug调试

https://gist.github.com/ankurk91/22e4a07be552790a9d6a063ee1bace05

注意phpstorm要以root权限启动,否则会出现Unable to save settings,可能是权限问题。
参考:https://intellij-support.jetbrains.com/hc/en-us/community/posts/115000394870--Unable-to-save-settings-error-

安装xdebug

sudo apt install php-xdebug

然后定位到xdebug安装到位置。

sudo updatedb
mlocate xdebug.ini

然后编辑xdebug.ini

xdebug.remote_enable = 1
xdebug.remote_port = 9000
xdebug.idekey = PHPSTORM
xdebug.show_error_trace = 1
xdebug.remote_autostart = 0
xdebug.file_link_format = phpstorm://open?%f:%l

然后重启apache服务。

sudo service apache2 restart

然后详情参考上面的gist,
注意最后在浏览器中打开的时候一定要在后面加上参数:

?XDEBUG_SESSION_START=1

在这里插入图片描述
在这里插入图片描述

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值