2

Useful informations:

  • Ubuntu 19.04 x86_64
  • PHP 7.2
  • Xampp for linux 7.3.4
  • Netbeans 8.2
  • Xdebug 2.7.1

I installed with success PHP-cli, netbeans and xampp for linux on my brand new Ubuntu 19.04 installation. After that I uploaded my /opt/lampp/etc/php.ini file on https://xdebug.org/wizard.php and I followed scrupulously the instructions. I copied the generated xdebug.so in /opt/lampp/lib/php/extensions/no-debug-non-zts-20180731 and then I edited the /opt/lampp/etc/php.ini adding those lines:

[xdebug]
zend_extension = /opt/lampp/lib/php/extensions/no-debug-non-zts-20180731/xdebug.so
xdebug.remote_autostart = 1
xdebug.remote_enable = 1
xdebug.remote_handler = dbgp
xdebug.remote_host = 127.0.0.1
xdebug.remote_log = /tmp/xdebug_remote.log
xdebug.remote_mode = req
xdebug.remote_port = 9000

I went to http://localhost/dashboard/phpinfo.php , here I can see the Zend Engine logo but in the "configuration" section there isn't any xdebug section.

In my local terminal i executed those commands php -m and php -v. The first returned a list of modules among which xdebug was not included, the second returned a the php version and, again, xdebug was not included.

After this I decided to add the [xdebug] section also in the /etc/php/7.2/cli/php.ini and then the php -m and php -v commands have returned xdebug in loaded modules and in the version list. Anyway the http://localhost/dashboard/phpinfo.php refuses to list xdebug among the active modules and if I try to start a debug session netbeans hangs-on "waiting for connection xdebug".

  • I checked two, three, four.... times the zend_extension path and is corrected
  • I restarted multiple times lampp, apache, netbeans and the pc
  • I tried multiple ports 9000, 9001, 9002 ....
  • The php and xdebug versions are compatible

Here are some similar problems: xdebug in phpinfo() is not showing , No xdebug in phpinfo() , Xdebug installed but does not display in Phpinfo for Xampp . Obviously, when I could, I tried these solutions, but without success.

  • Did you restart the server after making the changes? – Chris White May 04 '19 at 12:55
  • @ChrisWhite yes, multiple times – CapraNorvegese May 04 '19 at 12:58
  • The question is does xdebug work, do you get a xdebug related screen when you have a parse error or doing a var_dump? – Raymond Nijland May 04 '19 at 13:14
  • Check what php.ini file is used when checking via browser. It's in the top table output of `phpinfo()`. It's still possible that you are editing the wrong ini file. – LazyOne May 04 '19 at 18:07
  • @LazyOne ```phpinfo()``` says that the php.ini used by lampp is ```/opt/lampp/etc/php.ini``` which is the one that I edited. – CapraNorvegese May 04 '19 at 21:49
  • @RaymondNijland I'm not very sure how to do this... I thought that these things were visible in the xdebug output. But how do I see the output if netbeans is stuck at ```waiting for connection("netbeans-xdebug)``` – CapraNorvegese May 05 '19 at 15:44
  • Can you run `php -i`? It should show you same things as phpinfo() but in the CLI. Look for a XDebug. If it is there, then something is wrong with you web server – Damian Dziaduch May 06 '19 at 19:35
  • @DamianDziaduch phpinfo displays /etc/php/7.0/apache2/php.ini however (php -i |grep "php.ini") displays /etc/php/7.2/cli/php.ini now what? XDebug use to display at first, but I think it disappeared when I followed these instructions ( sudo apt-get install php-mbstring #debian) After and update/upgrade php -i shows /etc/php/7.4/cli/php.ini yet the 1st line of phpinfo says PHP Version 7.0.33-25+0~20200225.32+debian9~1.gbpa11893, I am totally confused, what do I do next? – Meryan Mar 28 '20 at 22:50
  • @Meryem seems that your xampp uses different php than your cli! What I can suggest is to check where is the path to php from xampp and add it your PATH env variable to make sure that cli uses same php as web server :) – Damian Dziaduch Mar 30 '20 at 21:15
  • @DamianDziaduch I never installed xampp so I think I don't have it, on top of Debian9 I got with my new VPS, I only installed apache then php. I resolved some of issues by purging all of PHP versions 5.6, 7.0..7.3, I think introduced by XDebug then only installed php7.4 +some extensions, so for now I only have 2 php.ini, if cli/php.ini is intended for doing php from the cli, (system prompt) then I don't plan to use that. All I needed is my server to run a php script when invoked from a URL. My understand may be wrong. Thanks. – Meryan Mar 31 '20 at 07:51

0 Answers0