vagrant-homestead安装xdebug

homestead默认没有安装xdebug

使用以下语句安装

wget https://xdebug.org/files/xdebug-2.6.0RC2.tgz
tar -zxvf xdebug-2.6.0RC2.tgz
cd ./xdebug-2.6.0RC2
sudo phpize
sudo ./configure --enable-xdebug
sudo make
sudo make install

sudo chmod 777 /etc/php/7.2/fpm/php.ini
echo "zend_extension = /usr/lib/php/20170718/xdebug.so
xdebug.remote_enable = on
xdebug.remote_handler = dbgp
xdebug.remote_connect_back=1
xdebug.remote_port = 9000
xdebug.remote_mode = req">>/etc/php/7.2/fpm/php.ini
sudo /etc/init.d/php7.2-fpm restart

xdebug-2.6.0RC2.tgz 源码的url按需修改

/etc/php/7.2/fpm/php.ini php配置文件按需修改

/usr/lib/php/20170718/xdebug.so xdebug拓展路径根据make install的结果修改

你可能感兴趣的:(php)