For Ubuntu <18.04:
sudo su
add-apt-repository ppa:ondrej/php
apt-get update
apt-get install libapache2-mod-fastcgi php5.6-fpm php5.6 php5.6-dev php5.6-mcrypt php5.6-mbstring php5.6-mysql php5.6-zip php5.6-gd php5.6-xml php7.1-fpm libapache2-mod-fastcgi php7.1-fpm php7.1 php7.1-dev php7.1-mbstring php7.1-mysql php7.1-zip php7.1-gd php7.1-xml php7.1-curl php7.1-intl php7.1-json php7.1-mcrypt
apt-get install -f php-xdebug
Edit /etc/php/5.6/fpm/conf.d/20-xdebug.ini
and add the lines:
xdebug.remote_host = localhost xdebug.remote_enable = 1 xdebug.remote_port = 9000 xdebug.remote_handler = dbgp xdebug.remote_mode = req
The xdebug part was a little bit tricky as we need to compile and build xdebug with a custom phpize version/php-config.
Basically you can follow the instrcutions of the official Xdebug page: https://xdebug.org/wizard.php
BUT: when it comes to ./configure, you need to set the a different php-config.
- Download xdebug-2.5.2.tgz
- Unpack the downloaded file with
tar -xvzf xdebug-2.5.2.tgz
- Run:
cd xdebug-2.5.2
- Run:
/usr/bin/phpize5.6
. - Run:
./configure --with-php-config=/usr/bin/php-config5.6
- Run:
make
- Run:
cp modules/xdebug.so /usr/lib/php/20131226
- Edit
/etc/php/5.6/fpm/php.ini
and add the linezend_extension = /usr/lib/php/20131226/xdebug.so
- Restart the webserver
sudo server php5.6-fpm restart