Grigoreas P.
Grigoreas P.

Reputation: 2472

xdebug with php 7 on ubuntu apache2 not working

actually had that problem and took me allot of time to figure out the solution: (if any previous php versions where installed, make sure to first get completely rid of them. if necessary purge and reinstall apache2 and php7)

first:

> sudo apt-get install php-xdebug

then edit the php.ini file of php 7 :

> sudo gedit /etc/php/7.0/apache2/php.ini

and just on the bottom add:

xdebug.remote_enable = On

save and of course then:

> sudo service apache2 restart

Upvotes: 6

Views: 7493

Answers (1)

Rafael Corrêa Gomes
Rafael Corrêa Gomes

Reputation: 1907

Download stable release of xdebug 2.4.0

wget -c "http://xdebug.org/files/xdebug-2.4.0.tgz"

Extract archive

tar -xf xdebug-2.4.0.tgz

cd xdebug-2.4.0/

Build extension

phpize
./configure
make && make install

Enable the extension

echo "zend_extension=xdebug.so" > /etc/apache2/mods-available/xdebug.ini

ln -sf /etc/apache2/mods-available/xdebug.ini /etc/apache2/mods-enabled/20-xdebug.ini
ln -sf /etc/apache2/mods-available/xdebug.ini /etc/apache2/mods-enabled/20-xdebug.ini

service php7.0-fpm restart

Check it

php -m | grep -i xdebug

It should print:

xdebug
Xdebug

Upvotes: 2

Related Questions