Xdebug problem with global variables

Post your questions and problem reports here

Moderator: kfury77

Forum rules
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

Postby jonathanp » Sun Feb 14, 2016 7:36 am

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
Last edited by jonathanp on Tue Feb 16, 2016 5:49 pm, edited 2 times in total.
jonathanp
 
Posts: 15
Joined: Thu Feb 04, 2016 4:17 am

Re: Xdebug problem with global variables

Postby jonathanp » Sun Feb 14, 2016 10:28 pm

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.

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' );

}


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.
jonathanp
 
Posts: 15
Joined: Thu Feb 04, 2016 4:17 am

Re: Xdebug problem with global variables

Postby jonathanp » Mon Feb 15, 2016 8:13 pm

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.
jonathanp
 
Posts: 15
Joined: Thu Feb 04, 2016 4:17 am

Re: Xdebug problem with global variables

Postby Aivars » Tue Feb 16, 2016 3:30 pm

Could you make a minimal project that reliably reproduces this issue and send it to me?
Blumentals Software Programmer
User avatar
Aivars
Blumentals Software Developer
 
Posts: 2453
Joined: Thu Aug 22, 2002 1:40 pm
Location: Latvia

Re: Xdebug problem with global variables

Postby jonathanp » Tue Feb 16, 2016 4:12 pm

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
jonathanp
 
Posts: 15
Joined: Thu Feb 04, 2016 4:17 am

Re: Xdebug problem with global variables

Postby jonathanp » Tue Feb 16, 2016 7:55 pm

Well, I just found this thread http://forums.blumentals.net/viewtopic.php?f=4&t=6786&p=23664#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
jonathanp
 
Posts: 15
Joined: Thu Feb 04, 2016 4:17 am

Re: Xdebug problem with global variables

Postby Aivars » Wed Feb 17, 2016 3:05 pm

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
User avatar
Aivars
Blumentals Software Developer
 
Posts: 2453
Joined: Thu Aug 22, 2002 1:40 pm
Location: Latvia

Re: Xdebug problem with global variables

Postby jonathanp » Wed Feb 17, 2016 4:13 pm

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?
jonathanp
 
Posts: 15
Joined: Thu Feb 04, 2016 4:17 am

Re: Xdebug problem with global variables

Postby jonathanp » Thu Feb 18, 2016 8:46 pm

I have just sent a PM to user gdermog (author of the thread above). Maybe the person have found a solution.
jonathanp
 
Posts: 15
Joined: Thu Feb 04, 2016 4:17 am


Return to HTMLPad / Rapid CSS / Rapid PHP / WeBuilder Support

Who is online

Users browsing this forum: No registered users and 6 guests

cron