I have configured the xdebug to the Netbeans IDE. My machine has been installed with XAMPP 1.7.4. it has php 5.3.5.
( In phpinfo() page i noticed,
Apache Version - Apache/2.2.17 (Win32) mod_ssl/2.2.17 OpenSSL/0.9.8o PHP/5.3.4
Debug Build - no
)
The version of xdebug is "php_xdebug-2.1.1-5.3-vc9.dll".
I kept this dll under the folder(directory) C\:xampp\php\ext.
And I done the settings in the file php.ini, under the folder --\php\php.ini.
I have done the folloing setting in the file php.ini
zend_extension_ts="C:xamppphpextphp_xdebug-2.1.1-5.3-vc9.dll"
;xdebug.remote_enable=true
xdebug.remote_enable=on
xdebug.remote_host=localhost
xdebug.remote_port=9000
xdebug.remote_handler=dbgp
xdebug.profiler_enable=0
xdebug.profiler_output_dir="C:xampptmp"
Later I tried to debug the php project.. debugger is not working. But in the IDE "Waiting For Connection (netbeans-xdebug)" message is getting.
I request you to current me.
Uncomment remote_enable=true, it is necessary
Enable xdebug.remote_log, e.g. xdebug.remote_log="/tmp/xdebug.log", it should tell you if xdebug attempts to connect to the IDE or not
If it doesn't attempt to connect, put an xdebug_break() call in your code, this should force the call to the IDE
Also note that you have to define an env variable to debug from CLI, and for browsers there are many extensions. Details on: http://xdebug.org/docs/remote
Related
I’m trying to do my first steps with PHP. I decided to use NetBeans, which seams helpful.
NetBeans is running on my local Windows machine. My testpage is running on an Apache2 webserver in my Ubuntu HyperV M.
Up to now everything works fine. Now I enabled remote debugging over Xdebug. Therefore I added the following lines to the php.ini:
[debug]
; Remote settings
xdebug.remote_autostart=off
xdebug.remote_enable=on
xdebug.remote_handler=dbgp
xdebug.remote_mode=req
xdebug.remote_host=192.168.2.20
xdebug.remote_port=9000
The connection is ok and debugging works. Unfortunately the debugger stops at each line and not only at my breakpoints. That makes my tests inefficient. Therefore my question is how to tell NetBeans to stop at breakpoints only?
Found the solution by myself. There is an option "stop at first line" in the Netbeans PHP debugging settings. Removing that did the trick.
I used to debug PHP code locally in PhpStorm using Xdebug but recently it just stopped working. When enabling listening Xdebug connections my PHP application immediately responds with empty response and I see ERR_EMPTY_RESPONSE in Chrome and Firefox. Debugger works though and execution stops on breakpoints as usual. When listening is disabled, application works as expected.
Project is running on local Apache Web Server, but I also explicitly specified path mappings.
How can I "debug" debugger to figure-out what prevents web-server from giving out http response?
xdebug.ini:
zend_extension=xdebug.so
[xdebug]
xdebug.remote_enable=1
xdebug.remote_autostart=1
xdebug.remote_port=8888
xdebug.profiler_enable=0
xdebug.profiler_output_dir="/var/opt/profiler"
xdebug.profiler_enable_trigger=0
xdebug.trace_enable=0
xdebug.trace_enable_trigger=0
xdebug.trace_output_dir="/var/opt/trace"
xdebug.max_nesting_level="1000"
xdebug.remote_host=localhost
xdebug.remote_mode=req
xdebug.idekey=PHPSTORM
PhpStorm debugger config:
I've run into this as well with PHP 7.1.27, xdebug 2.7.0. In webserver log on each debug request there was a message "zend_mm_heap corrupted".
The problem has been solved by upgrading to PHP 7.1.28 and xdebug 2.7.1
Based on this I think the only xDebug upgrade is crucial.
I'm on Windows and I'm trying to debug a Web application (hosted with Vagrant/Homestead) using PhpStorm through XDebug. I tried many configurations but I can't get things working. The PhpStorm XDebug setup is pretty common.
This is the current xdebug configuration:
vagrant#homestead: /etc/php/7.0/cli/conf.d/20-xdebug.ini
zend_extension=xdebug.so
xdebug.remote_enable = on
xdebug.remote_connect_back = on
xdebug.idekey='PHPSTORM'
In the IDE "Start listening for PHP debug connections" it's turned on. When I attempt to start debugging a new chrome tab opens and the URL ends, for example, with ?XDEBUG_SESSION_START=16588 but the debugger doesn't run and this is what the IDE says:
Also, netstat says the port 9000 is still listening.
Any idea?
You are changing the 20-xdebug.ini file for the Command Line Interface (CLI). Instead you need to change the /etc/php/7.0/apache2/conf.d/20-xdebug.ini for the Apache settings, since you are using Chrome.
UPDATE
I'm not sure of the differences between Apache and Nginx (which may be /etc/php/7.0/fpm/conf.d/20-xdebug.ini), but here is how I got it working with a VirtualBox VM running Apache, on a Windows computer.
Settings for 20-xdebug.ini:
zend_extension=xdebug.so
xdebug.remote_enable=1
xdebug.remote_host=192.168.1... (your windows IP address within your network)
xdebug.remote_port=9000
xdebug.autostart=1
When i tried to debug file it's hold's on 48% and comuniacate wrote says: Waiting for Xdebug session...
I am trying to get xdebug working with Eclipse Neon.1a / php (on xampp windows 7). I have verified that xdebug is enabled in phpinfo(); I have remote_debug=On.
I have installed xdebug with https://xdebug.org/wizard.php hints.
My php.ini file:
[xdebug]
zend_extension=/path/to/xdebug.so(.dll)
xdebug.remote_enable=On
xdebug.remote_handler=dbgp
xdebug.remote_mode=req
xdebug.remote_port=9001
xdebug.remote_host=localhost
xdebug.remote_log=/path/to/xdebug_remote_log
xdebug.remote_connect_back=1
I tried to use remote_port=9000 but problem doesn't perish.
In php.ini i have also commend:
zend_extension = D:\Serwer\xampp\php\ext\php_xdebug-2.4.1-7.0-vc14.dll
i tried to coment one line of zend_extension or another.
I have good settings in eclipse xdebug settings.
This is my first post on forum please be tolerant :)
you need to check the xdebug_remote_log, I got the same issue.
I: Connecting to configured address/port: 127.0.0.1:19006.
E: Time-out connecting to client. :-(
this is the error printed by xdebug.
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.