I have below settings in PHP.ini file for XDebug.
[XDebug]
;; Only Zend OR (!) XDebug
zend_extension_ts ="C:\xampp\php\ext\php_xdebug.dll"
xdebug.remote_enable=true
xdebug.remote_host=127.0.0.1
xdebug.remote_port=9001
xdebug.remote_handler=dbgp
xdebug.profiler_enable=1
xdebug.profiler_output_dir="C:\xampp\tmp"
You need to send a cookie called XDEBUG_PROFILE to the server. You can use browser plugins to do that for you like easy Xdebug (Firefox) or Xdebug helper (Chrome).
If you want to keep the debugger active, you can add this line to your php.ini:
xdebug.remote_autostart = 1
https://xdebug.org/docs/remote
Related
I need to debug my PHP scripts in a local environment but I'm having a "small" problem with my current set-up.
I was able to successfully install Xdebug, XAMPP, and the DBGp plugin for Notepad++.
The problem is that Xdebug is not showing up PHP variables in Notepad++
I already tried to disable OPCache, but it doesn't seem to be enough. phpinfo() seems to be fine..
These are my php.ini settings:
[opcache]
; Determines if Zend OPCache is enabled
opcache.enable=0
;zend_extension=php_opcache.dll
zend_extension = C:\xampp\php\ext\php_xdebug-2.7.0-7.2-vc15.dll
[xdebug]
xdebug.profiler_output_dir = "c:\xampp\tmp"
xdebug.profiler_output_name = "cachegrind.out.%p"
xdebug.profiler_enable = 0
xdebug.profiler_append=0
xdebug.extended_info=1
xdebug.remote_enable=1
xdebug.remote_handler=dbgp
xdebug.remote_mode=req
xdebug.remote_host=127.0.0.1
;xdebug.remote_host=localhost
xdebug.remote_port=9000
xdebug.idekey=xdebug
xdebug.remote_log="c:\xampp\tmp\xdebug_remot.log"
xdebug.show_exception_trace=0
xdebug.show_local_vars=9
xdebug.show_mem_delta=0
xdebug.trace_format=0
xdebug.max_depth=1
Any ideas on how to make this work?
I use WAMP locally and Atom as my editor. I want to use Xdebug, so I installed the php-debug package in Atom. In Chrome I have installed the addon "Xdebug Helper" to turn off and on Xdebug with a simple button and I also added the IDE key xdebug-atom in the settings.
I added these lines in php.ini for xdebug:
zend_extension ="c:/wamp/bin/php/php5.6.25/zend_ext/php_xdebug-2.4.1-5.6-vc11.dll"
xdebug.remote_enable=1
xdebug.idekey = "xdebug-atom"
xdebug.remote_host=127.0.0.1
xdebug.remote_connect_back=1
xdebug.remote_port=9000
xdebug.remote_handler=dbgp
xdebug.remote_mode=req
xdebug.remote_autostart=false
And in Atom I added these lines in config.cson:
"php-debug":
ServerAddress: "127.0.0.1"
ServerPort: 9000
currentPanelHeight: "292px"
currentPanelMode: "bottom"
I can toggle the Xdebug window in Atom and also set a breakpoint in my php script. But nothing happens when I reload my web application, I have tried changing all settings and rebooted both Atom and WAMP several times.
Can anyone see what I am doing wrong?
Finally I got it right. With these settings in php.ini the connection works:
zend_extension ="c:/wamp/bin/php/php5.6.25/zend_ext/php_xdebug-2.4.1-5.6-vc11.dll"
xdebug.remote_enable = On
xdebug.profiler_enable = off
xdebug.profiler_enable_trigger = off
xdebug.profiler_output_name = cachegrind.out.%t.%p
xdebug.profiler_output_dir ="C:/wamp/tmp"
xdebug.show_local_vars=0
xdebug.remote_autostart = 0
xdebug.remote_host=127.0.0.1
xdebug.remote_port=9000
I am trying to debug php code using Netbeans but I am unable to, it keeps showing Waiting for connection just like the image below and it stays like that.. I have opned the php.ini and found no xdebug so I added the following lines after installing xdebug and placing it in the path mentioned below.. please let me know what could the issue be .. i am out of ideas ...
[XDebug]
; Note that profiler is enabled separately.
zend_extension="C:\xampp\php\ext\php_xdebug-2.5.0-7.0-vc14-x86_64"
xdebug.remote_enable=1
xdebug.remote_handler=dbgp
xdebug.remote_host=127.0.0.1
xdebug.remote_port=9000
xdebug.remote_autostart=0
xdebug.remote_connect_back=0
xdebug.profiler_enable=0
xdebug.profiler_enable_trigger=0
xdebug.profiler_output_name=cachegrind.out.%s.%t
xdebug.profiler_output_dir="C:/WampDeveloper/Temp/xdebug"
xdebug.trace_output_dir="C:/WampDeveloper/Temp/xdebug"
I have a problem by xdebug in NetBeans and also PhpStorm!
After running the project in each IDE, in chrome it display this :
but it doesn't stop on any breakpoints!
However in NetBeans when I check Stop on first line of file, it stops on first line and I can debug that file, but again I have problem with break points too.
My php.ini Xdebug :
[XDebug]
zend_extension="C:\wamp\bin\php\php5.5.12\zend_ext\php_xdebug-2.2.5-5.5-vc11-x86_64.dll"
xdebug.remote_enable=1
xdebug.remote_handler=dbgp
xdebug.remote_host=127.0.0.1
xdebug.remote_port=9000
xdebug.remote_autostart=0
xdebug.remote_connect_back=0
What's the problem here?
I am trying to get XDEBUG up and going but having trouble getting the cookie to show. Below is what is put in my php.ini file. I restarted apache. I did a phpinfo() call and I do see xdebug enabled and the settings set. But when I do a localhost/?XDEBUG_SESSION_START=1 I am expecting to see a Cookie set to 1 in my browser right ?
zend_extension ="/usr/lib/php/extensions/no-debug-non-zts-20100525/xdebug.so"
xdebug.remote_enable=1
xdebug.profiler_enable=1
xdebug.remote_handler=dbgp
xdebug.remote_mode=req
xdebug.remote_host=127.0.0.1
xdebug.remote_port=9000
xdebug.profiler_output_dir="/tmp"
when I run php -m I do not see it but I do see it in phpinfo
couldnt figure the exact answer but I went and downloaded the php.ini.default file from repo and set the following in the php ini
zend_extension ="/usr/lib/php/extensions/no-debug-non-zts-20100525/xdebug.so"
xdebug.remote_enable=On
xdebug.remote_host=localhost
xdebug.idekey=foo
xdebug.profiler_enable=On
and it worked. could of been because of remote host. who knows. it worked. this is the bare minimum configurations for mac and this is if your going by the follwing installations for xdebug on mac
http://kubyshkin.ru/posts/installing-php-xdebug-extension-on-mac-os-x-10-7-lion.html