Skip to content

Instantly share code, notes, and snippets.

@kamilZ
Created December 5, 2015 00:10
Show Gist options
  • Star 20 You must be signed in to star a gist
  • Fork 6 You must be signed in to fork a gist
  • Save kamilZ/b11d1448e1479fe591f6 to your computer and use it in GitHub Desktop.
Save kamilZ/b11d1448e1479fe591f6 to your computer and use it in GitHub Desktop.
Install xdebug from sources php7.0
sudo apt-get install php7.0-dev
wget http://xdebug.org/files/xdebug-2.4.0rc2.tgz
tar -xzf xdebug-2.4.0rc2.tgz
cd xdebug-2.4.0RC2/
phpize
./configure --enable-xdebug
make
sudo cp modules/xdebug.so /usr/lib/.
#FOR FPM
sudo echo 'zend_extension="/usr/lib/xdebug.so"' > /etc/php/7.0/fpm/conf.d/20-xdebug.ini
sudo echo 'xdebug.remote_enable=1' >> /etc/php/7.0/fpm/conf.d/20-xdebug.ini
#FOR CLI
sudo echo 'zend_extension="/usr/lib/xdebug.so"' > /etc/php/7.0/cli/conf.d/20-xdebug.ini
sudo echo 'xdebug.remote_enable=1' >> /etc/php/7.0/cli/conf.d/20-xdebug.ini
#RESTART
sudo service php7.0-fpm restart
@wehdi
Copy link

wehdi commented May 11, 2016

nice ty
clarification :
20-xdebug.ini is a file that should be created

@thiagomata
Copy link

instead of using sudo echo "something" > /some/file.txt, you should use echo "something" | sudo tee /some/file.txt

For example:

echo '
zend_extension="/usr/lib/xdebug.so"
xdebug.remote_enable=1
' | sudo tee /etc/php/7.0/cli/conf.d/20-xdebug.ini 

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment