I made a mistake and allowed Ubuntu 18.04 updates to be installed. NetBeans 12.1 cannot connect to Xdebug after doing this with the same configuration. I think the problem is with the newer version of Xdebug (3.0.2).
# cat /etc/php/7.2/apache2/conf.d/20-xdebug.ini
zend_extension=xdebug.so
xdebug.remote_enable=on
xdebug.remote_log="/var/log/xdebug.log"
xdebug.remote_host=localhost
xdebug.remote_handler=dbgp
xdebug.remote_port=9003
Anyone faced such problem?
I have spent a whole day and a half trying to get the NetBeans ISE 12.0 debugger working - it was always hanging on “Waiting For Connection (netbeans-xdebug)”.
I have now solved this - as you say, Xdebug version 3 is very different to version 2 and most of the documentation on the web has not caught up. This is the page that you need: Upgrade Guide
This is the configuration that works for me (I kept my IDE setting to use port 9000):
zend_extension=/usr/lib/php/20180731/xdebug.so
xdebug.mode=debug
xdebug.start_with_request=trigger
xdebug.client_host=127.0.0.1
xdebug.client_port=9000
Related
The problem:
I can not get xdebug to work with PhpStorm or NetBeans in localhost. I have the proper Xdebug ext installed based on the wizard. I can see Xdebug is installed properly from phpinfo() and php -v output. I got a new hard drive at work with a new OS install and ever since then I can't get Xdebug setup to work.
I can not get the breakpoints to hit when accessing the application through the web/Postman. It's like the breakpoints aren't there or no connection is detected. There is no log file generated.
What does work:
In PhpStorm I hit the debug phpunit.xml icon then it runs my PHPUnit tests and Xdebug does work, breakpoints are hit, and log files are generated.
I have tried:
Many versions of Xdebug including 2.55, 2.60, 2.61 both 64 and 32 bit and both thread safe and non thread safe
Hosting with php -S and with XAMPP Apache
NetBeans and PhpStorm
My php.ini xdebug section
[Xdebug]
zend_extension=C:\xampp7.1\php\ext\php_xdebug-2.6.1-7.1-vc14.dll
xdebug.remote_enable=1
xdebug.var_display_max_depth = -1
xdebug.var_display_max_children = -1
xdebug.var_display_max_data = -1
xdebug.remote_host=127.0.0.1
xdebug.remote_port=9000
xdebug.remote_log=C:\xampp7.1\php\ext\xdebug.log
xdebug.idekey="PHPSTORM"
I don't know what else to try. I thought maybe it could be a company firewall issue or something but none of my coworkers have this issue nor did I before the new HD. I'm on Windows 10 Enterprise could it be some Windows configuration?
Credit to LazyOne for figuring out the solution!
Adding xdebug.remote_autostart=1 to the php.ini worked! Thanks so much
I work in a Mac (OSX 10.10.3 Yosemite), with Bitnami XAMPP 5.6.3, Netbeans 7.3.1, and the xdebug configuration showed down. With my "normal" PHP projects everything works fine, but now I am trying to learn Zend Framework, and I have installed ZendFramework-1.12.17, for which I reached to obtain a "Hello world" in a PHP 5.3 project, but when I try to debug the same project, the status bar of the debbuger remains "Waiting for connection netbeans-xdebug" forever.
I searched the web, but I think that this is so specific case that I could only find an answer on this forum recomending to install XAMPP 1.7.0 :( very old version) that has Zend Extension Manager, something that 1) doubt it can work with my configuration and 2) can affect my other projects.
Can someone help me please? Thank you and best regards.
In php.ini:
zend_extension = /Applications/XAMPP/xamppfiles/lib/php/extensions/no-debug-non-zts-20131226/xdebug.so
/xdebug.so
xdebug.remote_enable=1
xdebug.remote_handler=dbgp
xdebug.remote_mode=req
xdebug.remote_host=127.0.0.1
xdebug.remote_port=9000
I'm running Eclipse on Ubuntu 13.1 (I know, the worst Linux ever).
The fact is that I'm not used to Eclipse moved from Komodo 2 weeks ago, and the main reason why I'd migrated to Eclipse is debugging. But I can't put that to work. I already follow some tutorials with no joy.
My Xdebug is installed and working (checked with phpinfo()). I'm configuring Eclipse to work with Xdebug, but when I start the debugging it ignores the break points, even if I check to "Break at First Line" it won't break.
Here's a summary of the scenario that I have:
System: Ubuntu 13.1 64bits
PHP: 5.5.3-1ubuntu2.1
Xdebug: 2.2.3
Eclipse Platform: 3.6.2
PDT: 2.2.1
Tnx!
Problem solved! Actually the xdebug was installed but I missed one configuration. The xdebug.ini file was with only the following line:
zend_extension=/usr/lib/php5/20121212/xdebug.so
I'd added the following lines:
xdebug.remote_enable=1
xdebug.remote_handler=dbgp
xdebug.remote_mode=req
xdebug.remote_host=127.0.0.1
xdebug.remote_port=9000
and it's working! Just reconfigured the eclipse debug and is working.
After upgrading to php 5.4.16 and installing netbeans IDE 7.3.1 on my mac osx 10.8.4 Netbeans reports a 'waiting for connection (Netbeans - xdubug)' when initiating the debugging. I tried a few things as suggested on Waiting For Connection (netbeans-xdebug) MAMP OS X and xDebug seems OK installed, but not connecting with NetBeans, but nothing helped sofar. Having said that, I'm not very experienced with these kind of installations and the mac osx ;-(
Some more info:
I use Apache/2.2.22 and mysql.
I upgraded to php 5.4.16 using http://php-osx.liip.ch/. After that upgrade the php.ini file does not include xdebug info, but the 50-extension-xdebug.ini file does contain the following info:
zend_extension=/usr/local/php5/lib/php/extensions/no-debug-non-zts-20100525/xdebug.so
[xdebug]
xdebug.remote_enable=on
xdebug.default_enable=on
xdebug.remote_autostart=off
xdebug.remote_port=9000
xdebug.remote_host=localhost
xdebug.profiler_enable_trigger=1
xdebug.profiler_output_name=xdebug-profile-cachegrind.out-%H-%R
xdebug.var_display_max_children = 128
xdebug.var_display_max_data = 2048
xdebug.var_display_max_depth = 128
Then I added:
xdebug.idekey=netbeans-xdebug
xdebug.remote_log=/tmp/xdebug.log
..to this 50-extension-xdebug.ini file (as somewhere suggested in xDebug seems OK installed, but not connecting with NetBeans).
I made another attempt by adding the contents of 50-extension-xdebug.ini to php.ini and restart the server, but no result.
The info box for xdebug shown by phpinfo() indicates xdebug is enabled and IDE Key is netbeans-xdebug. Then again, using the 'php -i | grep xdebug' terminal command doesnt show any result, so I'm not sure whether xdebug is actually enabled or not (?)
Any suggestions with respect to fixing the connection problem?
Thank you in advance.
I am trying to debug with NetBeans Mac locally.
This is my php.ini
[xdebug]
xdebug.default_enable=1
xdebug.remote_enable=1
xdebug.remote_handler=dbgp
xdebug.remote_host=localhost
xdebug.remote_port=9000
xdebug.remote_autostart=1
xdebug.remote_log="/Applications/MAMP/logs/xdebug.log"
xdebug.idekey="netbeans-xdebug"
zend_extension="/Applications/MAMP/bin/php/php5.4.10/lib/php/extensions/no-debug-non-zts-20100525/xdebug.so"
This is what I had been getting in xdebug.log
I: Connecting to configured address/port: localhost:9000.
E: Could not connect to client. :-(
I try changing the port to 9001 and turn off firewall and it didn't help.
Xdebug's default port (9000) conflicts with FastCGI (Xdebug was first!) - the solution is to change it to another port. After having done that, you need to restart your IDE where you will also need to configure the new port. You will also need to restart PHP and your Web Server.
Step 1:
Change xdebug.remote_port=9000 to xdebug.remote_port=9001
Step 2:
Change the debugging port in Netbeans. Go to Tools >> Options >> Click PHP tab
Under PHP tab click debugging
Change the debugger port : 9001
Change Session ID : netbeans-xdebug
Step 3:
Restart server and netbeans
Step 4:
Set a breakpoint and try
I had exact the same problem.
The xdebug installion wizard (https://xdebug.org/wizard.php) showed that my xdebug was correctly installed. (The wizard told me to install the Xdebug 2.5.0rc1 dll)
In phpinfo I also got a xdebug section showing (in my opinion) the correct values. Even with this I got a "could not connect to client" message in the error log.
Eventually I solved it by trial and error doing the following:
Downloaded all the older versions of the xdebug dll's for my php version and tried them all. Eventually one of them worked. For me it was with php 5.6.8 the xdebug 2.4.1 dll (PHP 5.6 VC11 TS (32 bit) ) on a windows 7 32 bit machine. I am using xampp-win32-5.6.8-0-VC11.zip for my xampp installation.
What I learned was the following:
(a) The Xdebug wizard does not neccesarily give the correct dll to use
(b) Even though phpinfo shows a Xdebug section with correct variables this does not necessarily mean that it is correct.
(c) Try older versions of the dll's if you get this error.