Xdebug problem with global variables
Moderator: kfury77
Forum rules
Please try to follow these guidelines. This will help to receive faster and more accurate response.
Please try to follow these guidelines. This will help to receive faster and more accurate response.
- Check the Support section of the corresponding product first. Chances are you will find your answer there;
- Do not create new topics for already reported problems. Add your comments to the existing topics instead;
- Create separate topic for each problem request. Do NOT post a number of non-related problem reports in a single topic;
- Give your topic a meaningful title. Titles such as "A question," "Bug report" and "Help!" provide others no clue what your message is about;
- Include the version number of the software you are using;
- This is not an official customer support helpdesk. If you need a prompt and official response, please contact our support team directly instead. It may take a while until you receive a reply in the forum;
Xdebug problem with global variables
Hello,
I am using WeBuilder 2015 Version 13.5 (13.5.0.169) with WampServer 2.5 (Xdebug version 2.2.5).
I have a serious problem when debugging PHP scripts with Xdebug. When there is a global variable declared in a function with the global keyword, the debugger hangs after I click on any debug button after hitting a breakpoint, by example the "Run" or "Step Over" button. I tried to debug with Notepad++ with the plugin DBGp and it works fine.
Any help?
Thanks
I am using WeBuilder 2015 Version 13.5 (13.5.0.169) with WampServer 2.5 (Xdebug version 2.2.5).
I have a serious problem when debugging PHP scripts with Xdebug. When there is a global variable declared in a function with the global keyword, the debugger hangs after I click on any debug button after hitting a breakpoint, by example the "Run" or "Step Over" button. I tried to debug with Notepad++ with the plugin DBGp and it works fine.
Any help?
Thanks
Last edited by jonathanp on Tue Feb 16, 2016 5:49 pm, edited 2 times in total.
Re: Xdebug problem with global variables
I found that it may not be related directly to global variables. I did a small project (1 php file) and it is working perfectly, no debugger hang.
In fact, the hang I am experimenting is when I debug a WordPress site. By example, on WordPress core file /wp-blog-header.php, if I hit "Step Over" before calling wp() function on the code below, debugger is hanging indefinitely.
Something interesting, I found that each time the tooltip for a variable (when I put my mouse cursor over a variable) is saying "Loading...", the next time I hit "Step Over" (or another debug buttons), the problem occurs and the debugger hangs. By example, in the code above, it happens when I am on the first require_once line. In other words, after hitting "Step Over" on that line, it is impossible to get value for variable $wp_did_header and if I hit "Step Over" again, it hangs.
In fact, the hang I am experimenting is when I debug a WordPress site. By example, on WordPress core file /wp-blog-header.php, if I hit "Step Over" before calling wp() function on the code below, debugger is hanging indefinitely.
Code: Select all
if ( !isset($wp_did_header) ) {
$wp_did_header = true;
require_once( dirname(__FILE__) . '/wp-load.php' );
wp();
require_once( ABSPATH . WPINC . '/template-loader.php' );
}
Re: Xdebug problem with global variables
I forgot to say that WeBuilder and my web server (WampServer 2.5) is running on the same machine.
It can be potentially a Windows Firewall issue. I am using it on Windows 10. But I am not confident because there is a rule for the application webuilder.exe. I will try to disable that firewall completely just to see.
I will also try to change port. Xdebug configuration is right now the default, which is remote host 127.0.0.1 on port 9000.
It can be potentially a Windows Firewall issue. I am using it on Windows 10. But I am not confident because there is a rule for the application webuilder.exe. I will try to disable that firewall completely just to see.
I will also try to change port. Xdebug configuration is right now the default, which is remote host 127.0.0.1 on port 9000.
Re: Xdebug problem with global variables
Could you make a minimal project that reliably reproduces this issue and send it to me?
Blumentals Software Programmer
Re: Xdebug problem with global variables
Hi Aivars,
Yesterday I tried to disable Windows Firewall, but the problem still occurs.
I have also did a netstat to see if the connection between Apache (Xdebug) and WeBuilder is properly initiated. It's the case, the ports are really open.
Yes, I can give you a project where I have the problem. Right now, I can't however. It will be in a few hours. In fact, what you can do if it's possible is to trace on debug the code above on a fresh WordPress installation. I am sure you have one near you! I have the latest version, the 4.4.2. On an "empty" site, I have no trouble to debug.
Again, for the same project, with Notepad++ with DBGp plugin, I have no problem. It's important for me to be able to properly trace code on a WordPress site. I will have to code plugins.
Thanks
Jonathan
Yesterday I tried to disable Windows Firewall, but the problem still occurs.
I have also did a netstat to see if the connection between Apache (Xdebug) and WeBuilder is properly initiated. It's the case, the ports are really open.
Yes, I can give you a project where I have the problem. Right now, I can't however. It will be in a few hours. In fact, what you can do if it's possible is to trace on debug the code above on a fresh WordPress installation. I am sure you have one near you! I have the latest version, the 4.4.2. On an "empty" site, I have no trouble to debug.
Again, for the same project, with Notepad++ with DBGp plugin, I have no problem. It's important for me to be able to properly trace code on a WordPress site. I will have to code plugins.
Thanks
Jonathan
Re: Xdebug problem with global variables
Well, I just found this thread http://forums.blumentals.net/viewtopic. ... 664#p23664. It seems to be the same problem I have!!! No reply since last december. Probably that the person resolved the problem. In my case, this is a unmodified WordPress installation. I was trying it just to test the debugger capability.
I really need that fixed, otherwise I will have to change to another IDE.
Sorry for posting that much in this thread.
Thanks
I really need that fixed, otherwise I will have to change to another IDE.
Sorry for posting that much in this thread.
Thanks
Re: Xdebug problem with global variables
We didn't get the test project that time. I've never worked with WordPress, is there no way to distill the problematic line down without having to set up the database and everything that WP requires?
Blumentals Software Programmer
Re: Xdebug problem with global variables
Sorry, I forgot yesterday to send you my test project. Again, right now I can't send it, I am not on my development station.
For me, right now I see no way to make a more simple project to reproduce the problem.
Since I have to work with WordPress and wanted to test the debugger, I downloaded the WordPress zip archive (https://wordpress.org/), it tooks 30 seconds, and unzipped it in my web root. If you have already a local web server with MySQL (which I think you have!), it takes 1 minute to install, really. Create an empty db, then browse to the site and follow simple steps. Otherwise, you can debug remotely with an existing installation. Your co-worker do not have a WordPress installation already for you to test?
For me, right now I see no way to make a more simple project to reproduce the problem.
Since I have to work with WordPress and wanted to test the debugger, I downloaded the WordPress zip archive (https://wordpress.org/), it tooks 30 seconds, and unzipped it in my web root. If you have already a local web server with MySQL (which I think you have!), it takes 1 minute to install, really. Create an empty db, then browse to the site and follow simple steps. Otherwise, you can debug remotely with an existing installation. Your co-worker do not have a WordPress installation already for you to test?
Re: Xdebug problem with global variables
I have just sent a PM to user gdermog (author of the thread above). Maybe the person have found a solution.