Run php -i
and copy the output of the following command and paste it on https://xdebug.org/wizard.php.
Follow the instructions there to install xDebug.
Example:
-
Download xdebug-2.6.0.tgz:
wget http://xdebug.org/files/xdebug-2.6.0.tgz
-
Unpack the downloaded file with
tar -xvzf xdebug-2.6.0.tgz
-
Run:
cd xdebug-2.6.0
-
Run:
phpize
As part of its output it should show:
Configuring for:
...
Zend Module Api No: 20170718
Zend Extension Api No: 320170718
If it does not, you are using the wrong phpize. Please follow this FAQ entry and skip the next step.
-
Run:
./configure
-
Run:
make
-
Run:
cp modules/xdebug.so /usr/lib/php/20170718
-
Edit
/etc/php/7.2/cli/php.ini
and add the linezend_extension = /usr/lib/php/20170718/xdebug.so
Open sudo vi /etc/php/7.2/fpm/conf.d/20-xdebug.ini
and add some lines
zend_extension = /usr/lib/php/20170718/xdebug.so
xdebug.remote_enable = 1
xdebug.remote_connect_back = 1
xdebug.remote_port = 9000
Note:
- 20170718 can change depend on your xdebug version. Get it on xdebug wizard above.
- If
20-xdebug.ini
wasn't in/etc/php/7.2/fpm/conf.d/20-xdebug.ini
. Try find it at/etc/php/7.2/mods-available/xdebug.ini
, editxdebug.ini
and runsudo ln -s /etc/php/7.2/mods-available/xdebug.ini /etc/php/7.2/fpm/conf.d/20-xdebug.ini
to create symlink between them.
Run sudo service php7.2-fpm restart
command.
thanks, it works