I'm trying to open xdebug profiler output in PhpStorm, but I'm getting an error:
Incorrect profiler snapshot format
For input string: "fl=(2)"
I can't seem to find any indication as to what could be causing this.
I'm on OSX 10.13.4, PhpStorm version 2018.1, running the process on PHP 5.6.33 with xdebug 2.5.5
Here's my php.ini configuration:
[xdebug]
zend_extension=/usr/local/Cellar/php56/5.6.33_9/lib/php/xdebug.so
xdebug.profiler_enable=1
xdebug.profiler_output_dir=/tmp/debug/
xdebug.profiler_output_name=cachegrind.out.%c
xdebug.profiler_enable_trigger=1
xdebug.remote_enable=1
xdebug.remote_host=localhost
xdebug.remote_port=9000
xdebug.idekey=PHPSTORM
The profiler output looks a bit weird I think, for example:
fl=(2)
fn=(5) php::spl_autoload_call
23 80
cfl=(1)
cfn=(4)
calls=1 0 0
23 2045
I don't know what those numbers in parenthesis are there for, but I think this is what's tripping PhpStorm's analyser.
I think I found the source of the issue, or at least part of it.
It looks like it has to do with the script itself. Hard to tell why exactly, maybe because it spins up a daemon process and that could potentially mess with the profiler, not sure. But if I run the profiler on something else it works.
This is my configuration give it a try:
zend_extension=/usr/lib/php5/20090626/xdebug.so
xdebug.idekey=PHPSTORM
xdebug.default_enable=1
xdebug.remote_enable=1
xdebug.remote_handler="dbgp"
xdebug.remote_host=127.0.0.1
xdebug.remote_port=9001
xdebug.remote_mode=req
xdebug.remote_autostart=0
xdebug.remote_connect_back=1
xdebug.remote_log = "/tmp/xdebug_cli.log"
xdebug.profiler_enable=1
PHPStorm settings:
And remember to enable the listening in phpstorm:
Related
I'm trying to connect PhpStorm and debug PHP scripts/webpages with Xdebug, something I've done several times.
This is my php.ini file (the interesting bit):
[xdebug]
zend_extension=C:\xampp\php\ext\php_xdebug.dll
xdebug.remote_enable=1
xdebug.remote_port=10000
xdebug.remote_mode=req
I set multiple breakpoints and called xdebug_break() on my index but code execution is not stopping at them.
This is the PhpStorm validation script output for Xdebug:
The output of netstat which shows that PhpStorm is listening on port 10000:
Change
from
xdebug.remote_enable=1
xdebug.remote_port=10000
xdebug.remote_mode=req
into
xdebug.mode=debug
xdebug.start_with_request=yes
xdebug.client_port=10000
Change the lines in the php.ini to
xdebug.mode=debug
and set the port on PhpStorm to listen on 9003 instead of 9000.
In xdebug v3 the default xdebug port was changed to 9003:
https://xdebug.org/docs/upgrade_guide#Step-Debugging
phpinfo() shows the path to the configuration: /etc/php5/apache2/conf.d/20-xdebug.ini
But the file contains only a string: zend_extension=xdebug.so
The file usr/lib/php5/20100525/xdebug.so looks like this:
In php.ini, there are no lines containing "xdeb" or "remote_connect"
UP: What I need? The phpinfo() shows that the xdebug.remote_connect_back setting is off. I need to turn it on.
Just fill your /etc/php5/apache2/conf.d/20-xdebug.ini with something like :
zend_extension=xdebug.so
xdebug.remote_enable=1
xdebug.remote_connect_back=1
xdebug.remote_host=localhost
xdebug.remote_port=9000
xdebug.remote_handler=dbgp
xdebug.max_nesting_level=10000
;...
And restart apache. All settings from xdebug are available here
I have followed this guide however when I start debuggin the application it debugs every single action and not only the breakpoints that I marked.
the php.ini configuration is the following:
[Xdebug]
zend_extension = C:\xampp\php\ext\php_xdebug-2.4.1-5.6-vc11.dll
xdebug.default_enable=1
xdebug.remote_enable=1
xdebug.idekey=PHPSTORM
xdebug.remote_port = 9000
Do I need another step for it to work..? thanks in advance
i'm already two days trying to configure the notepad ++ DBGp debug plugin and its still not working.
I already search a lot of internet site's but no succes.
My setup is the following:
I have my pc:
with notepad ++ installed on.
and i have a windows server running with iis7 and has the following ip :10.83.A.B
On the windows server i installed Xdebug in the php.ini file:
zend_extension = C:\PHP\ext\php_xdebug-2.2.5-5.5-vc11-nts.dll
[PHP_XDEBUG-2.2.5-5.5-VC11-NTS]
xdebug.remote_enable=on
xdebug.remote_handler=dbgp
xdebug.remote_host=10.83.A.B
xdebug.remote_port=9000
xdebug.remote_log="C:\inetpub\wwwDevelop\logs"
xdebug.idekey=debug
if i check phpinfo the Xdebug module is showed.
the DBGp configuration on my laptop in notepad is the following;
Remote Server : 10.83.A.B
IDE KEY : debug
Remote Path:\\SERVER-NAME\inetpub\wwwDevelop
Local Path:\\SERVER-NAME\inetpub\wwwDevelop
I had the same situation, adding in all the following got it working for me. Substituting paths of course. Perhaps you're missing an important one...
zend_extension = C:\PHP\ext\php_xdebug-2.2.5-5.5-vc11-nts.dll
xdebug.remote_enable=1
xdebug.remote_handler=dbgp
xdebug.remote_host=127.0.0.1
xdebug.remote_mode=req
xdebug.idekey=default
xdebug.remote_log="D:/www/ourcommunity.dev/log/xdebug.log"
xdebug.remote_port=9000
xdebug.show_exception_trace=0
xdebug.show_local_vars=9
xdebug.show_mem_delta=0
xdebug.trace_format=0
I've been trying to configure xdebug to work along with netbeans, my current configuration is
[xdebug]
zend_extension="C:\binaries\php\ext\php_xdebug-2.1.0RC1-5.3-vc6.dll"
xdebug.remote_enable=on
xdebug.remote_handler=dbgp
xdebug.remote_host=127.0.0.1 (also tried localhost)
xdebug.remote_port=9000
xdebug.idekey="netbeans-xdebug"
I tried the test provided by a netbeans blog explaining how to test if the configuration works when binding it just outputs "unable to bind"
Any suggestions?
A couple of things off the top of my head...
Firstly, check that nothing else is already listening to port 9000 (on the command line, type netstat -an ).
If that doesn't show anything, make sure the Windows Firewall is not enabled.
This was my Solution for the same issue.
The Configuration of xdebug in the php.ini is minimalized.
php.ini:
[XDebug]
zend_extension = C:\Bitnami\wampstack-5.6.21-2\php\ext\php_xdebug.dll
xdebug.remote_enable=1
xdebug.remote_handler=dbgp
xdebug.remote_host=127.0.0.1
xdebug.remote_port=9001
xdebug.remote_autostart=0
xdebug.remote_connect_back=0
Right click Project > Run configuration:
Project URL: http://127.0.0.1:9000/<ProjectName>/
Index File: index.php
Tools > Options > PHP > Debugging
Debugger Port: 9001
Session ID: netbeans-xdebug
Maximum Data Length: 2048
uncheck all Checkboxes
The Debugger Port has to be another than the Server Port. The Ports defined in netbeans have to match the one defined in php.ini(xdebug-port) and httpd(apache-port)
Server: 127.0.0.1:9000
XDebug: 127.0.0.1:9001
Close netbeans and restart the server, open Netbeans and press CTRL+F5 (Run Debug).
This worked For Ubuntu 16.04, Net beans 8.2
open xdebug.ini (for me it was in /etc/php/{php-version}/mods-available) and put
zend_extension=xdebug.so
xdebug.remote_enable=1
xdebug.remote_handler=dbgp
xdebug.remote_mode=req
xdebug.remote_port=9000
Net beans -> Tools > Options > PHP > Debugging
Debugger Port: 9000
Session ID: netbeans-xdebug
Maximum Data Length: 2048
unchecked all Check-boxes here.
My configs were just fine as mentioned above but it wasn't working fine until i unchecked all check-boxes as mentioned by #Beka.