Debugging with NetBeans and xdebug

Discuss general development subjects that are not specific to a particular version like the versioning control system we use or other infrastructure.
Post Reply
HAZET
Registered User
Posts: 5
Joined: Sun Jul 17, 2016 1:10 pm

Debugging with NetBeans and xdebug

Post by HAZET » Sun Jul 17, 2016 1:25 pm

Hi,

I dare asking a newbie question, please do not beat me up for it. I am trying to get a grip of phpBB development, at least some basic stuff. I'd like to debug some extensions, improve and contribute where I can. I know a little PHP, have some experience with NetBeans and xdebug, not much, but it was good enough to understand some Joomla! and Typo3 a while back.

Now, with phpBB I feel lost. Hope someone out there can give me a helpful hint.

The debugger is running, there seems to be some interaction with NetBeans. But I do not seem to end up in the correct files. I am sure I have set the paths correctly. Now I see the requested URLs look like
http://localhost/phpBB-bfm/adm/index.php?i=acp_main&sid=[someSID]&mode=main
acp_main.php looks exactly like the file I am supposed to see, but Netbeans steps through index.php. I tried setting breakpoints for the code-lines I am interested in, nothing happens. What can I do to get this right? Is there a tutorial on how to set up your development environment for beginners maybe?

Thank you!
Henrik

CHItA
Development Team
Development Team
Posts: 128
Joined: Thu Mar 12, 2015 1:43 pm
Location: Budapest, Hungary

Re: Debugging with NetBeans and xdebug

Post by CHItA » Sun Jul 17, 2016 8:52 pm

Not sure if that's your problem, but to me it sounds like you don't use step into. If that's not your problem, please try to be a bit more specific about what you're trying to do.

HAZET
Registered User
Posts: 5
Joined: Sun Jul 17, 2016 1:10 pm

Re: Debugging with NetBeans and xdebug

Post by HAZET » Mon Jul 18, 2016 4:00 pm

Hi CHItA,
alas, that's not it, that would be too simple. As I said, I do have some experience debugging Joomla! and Typo3. ;)

I wanted to figure out how the resync actions on the acp's first page work. I had an idea which code is executed, so I set a breakpoint, but it looked as if the code were never executed. What happens instead is, the debugger is hopping through index.php line by line, stopping even at blank lines. That made me wonder.

I klick on the button to execute a stats resync, I see a URL called like

Code: Select all

http://localhost/phpBB-bfm/adm/index.php?i=acp_main&sid=[someSID]&mode=main
So I guess the debugger should be in acp_main.php, not in index.php.
How can I debug that kind of call?

Thanks
Henrik

HAZET
Registered User
Posts: 5
Joined: Sun Jul 17, 2016 1:10 pm

Re: Debugging with NetBeans and xdebug

Post by HAZET » Mon Jul 18, 2016 4:04 pm

Think I have it. It is using the wrong index.php. It should be adm/index.php, but what I see is index.php. Why I wonder?

HAZET
Registered User
Posts: 5
Joined: Sun Jul 17, 2016 1:10 pm

Re: Debugging with NetBeans and xdebug

Post by HAZET » Mon Jul 18, 2016 4:26 pm

Think I should mention I am using XAMPP. Could be part of the problem :(

CHItA
Development Team
Development Team
Posts: 128
Joined: Thu Mar 12, 2015 1:43 pm
Location: Budapest, Hungary

Re: Debugging with NetBeans and xdebug

Post by CHItA » Wed Jul 20, 2016 3:05 pm

It seems that something is not right with your editor/xdebug setup. Unfortunately I'm not quite sure what the problem might be exactly.

HAZET
Registered User
Posts: 5
Joined: Sun Jul 17, 2016 1:10 pm

Re: Debugging with NetBeans and xdebug

Post by HAZET » Mon Jul 25, 2016 3:39 pm

The path-matching didn't work. I do not yet know 100% why. Eventually I decided to get rid of xampp and set up a VM for my tests. I also used xdebug's logging function (xdebug-remote_log) to find what exactly was sent to the debugger. After I added a path-mapping in Netbeans, it now works.

Thank you for your replies, they made me confident it should work and I'd get there.

Post Reply