Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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
like image 573
Grigoreas P. Avatar asked May 20 '16 20:05

Grigoreas P.


People also ask

Does Xdebug work with php 8?

PHP Version Support # In general, at any point when an Xdebug version is released, it will support the currently supported PHP versions. On Windows you need at least PHP 7.4. 20 or PHP 8.0.


1 Answers

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
like image 112
Rafael Corrêa Gomes Avatar answered Sep 30 '22 04:09

Rafael Corrêa Gomes