Skip to content

Instantly share code, notes, and snippets.

@developerdino
Last active March 6, 2022 10:17
Show Gist options
  • Save developerdino/f297917aba10df587c65 to your computer and use it in GitHub Desktop.
Save developerdino/f297917aba10df587c65 to your computer and use it in GitHub Desktop.
Setup XDebug on Laravel Homestead 4.0 with PHP 7.0
#!/usr/bin/env bash
wget http://xdebug.org/files/xdebug-2.4.0rc3.tgz
tar -xvzf xdebug-2.4.0rc3.tgz
cd xdebug-2.4.0RC3
phpize
./configure
make
sudo cp modules/xdebug.so /usr/lib/php/20151012
cat << XDEBUG | sudo tee /etc/php/mods-available/xdebug.ini
; configuration for php xdebug module
; priority=20
zend_extension=/usr/lib/php/20151012/xdebug.so
xdebug.idekey="phpstorm"
xdebug.remote_enable=1
xdebug.remote_connect_back=1
xdebug.remote_port=9000
xdebug.max_nesting_level=300
xdebug.scream=0
xdebug.cli_color=1
xdebug.show_local_vars=1
XDEBUG
sudo ln -sf /etc/php/mods-available/xdebug.ini /etc/php/7.0/fpm/conf.d/20-xdebug.ini
# sudo ln -sf /etc/php/mods-available/xdebug.ini /etc/php/7.0/cli/conf.d/20-xdebug.ini
sudo service php7.0-fpm restart
# cleanup
rm -rf xdebug-2.4.0*
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment