2
votes

I am trying to debug php using xdebug on ubuntu 16.04 with Visual Studio code. I installed xdebug as per the instructions from the following site-Xdebug wizard. In the xampp the php version is shown as PHP Version 5.5.6 but when i run the command php -v in terminal, it shows

PHP 7.0.15-0ubuntu0.16.04.4 (cli) ( NTS )
Copyright (c) 1997-2017 The PHP Group
Zend Engine v3.0.0, Copyright (c) 1998-2017 Zend Technologies
with Zend OPcache v7.0.15-0ubuntu0.16.04.4, Copyright (c) 1999-2017,
by Zend Technologies

I don't know if that may cause any problem. But, the real issue is that Debugger doesn't stop at any breakpoints. Also, it sometimes shows unverified breakpoint message. Sometimes it just runs and never stop at any breakpoints. The Xdebug options don't fully show up in phpinfo() page even after the installation. I don't understand the problem.

2
the problem is you installed xdebug for 5.5, but your xampp is using 7.0. Either change version, or install xdebug for 7.0 - Milan Markovic
i have upgraded xampp to php7 and reinstalled xdebug...still it does not work... when i use "Launch Chrome" configuration on vs code, it shows "Breakpoint ignored because generated code not found (source map problem?)." - Gadheyan .t.s

2 Answers

2
votes

make sure you have configure xdebug.ini file. here mine.

     [xdebug]
     zend_extension=xdebug.so
     xdebug.remote_autostart=1
     xdebug.remote_log=/var/log/apache2/xdebug.log
     xdebug.default_enable = 1
     xdebug.remote_enable=1
     xdebug.remote_port=9000
-2
votes

sudo apt-get install php-xdebug