配置 xdebug
homestead安装完成后,想使用xdebug来方便调试代码。
默认的环境里面已经有xdebug扩展了,现在需要配置一下使其能在PHPSTORM里面使用。
vagrant@homestead:~$ vim /etc/php/7.1/fpm/conf.d/20-xdebug.ini
增加一行,自动启动调试。(可以避免安装浏览器xdebug插件啊、设置IDE KEY啥的)
xdebug.remote_autostart = 1
修改完成之后,重启fpm。
vagrant@homestead:~$ /etc/init.d/php7.1-fpm restart
[....] Restarting php7.1-fpm (via systemctl): php7.1-fpm.service==== AUTHENTICATING FOR org.freedesktop.systemd1.manage-units ===
Authentication is required to restart 'php7.1-fpm.service'.
Authenticating as: vagrant,,, (vagrant)
Password:
==== AUTHENTICATION COMPLETE ===
. ok
密码为 vagrant
浏览器再访问 https://homestead.app/ (让你的 Homestead 站点支持 HTTPS),在IDE上就能看到
xdebug配置成功,可以愉快的看代码了。
本作品采用《CC 协议》,转载必须注明作者和本文链接
推荐文章: