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