Question about usual debugging techniques for MyBB development
hansolo Offline
Junior Member
**
Posts: 22
Joined: Sep 2015
Post: #1
Question about usual debugging techniques for MyBB development
Hi All,

At the moment I'm working on a complicated plugin. Basically, whenever anything goes wrong in the PHP code I'm completely blind, and this makes it nigh on impossible to solve the problem.

How can I see what is going on in the code? I've tried the recommended <script>console.log... method but this just causes an encoding error. Also FireBug allows some level of debuggability for JavaScript code files, but doesn't cover the highly nested PHP plugin files. I also found the NetBeans 'debug' feature didn't work right and was just useless.

So how do the developers here 'get eyes into the execution of the code', and debug this stuff?

Cheers!
11-23-2015 11:25 PM
Find all posts by this user Quote this message in a reply
ZiNgA BuRgA Offline
Fag
*******
Posts: 3,357
Joined: Jan 2008
Post: #2
RE: Question about usual debugging techniques for MyBB development
print_r
var_dump

Debuggers exist (XDebug), but I suspect most people just dump the output of variables.

My Blog
12-03-2015 05:15 PM
Find all posts by this user Quote this message in a reply
hansolo Offline
Junior Member
**
Posts: 22
Joined: Sep 2015
Post: #3
RE: Question about usual debugging techniques for MyBB development
Cheers,
I ended up getting a debugging regime working, I'll post it here for reference:

1) Have a local server. For windows, I have EasyPHP DevServer.
2) Make sure it has XDebug installed. I updated my XDebug on my local server to the latest version as follows:
a) On your local server, make a php file which calls phpinfo(), then open that file in browser.
b) copy and paste that output to http://xdebug.org/wizard.php
c) follow that wizard's instructions
3) Get the latest Netbeans IDE, and install the plugin called "PHP".
4) In Tools > Options > PHP > Debugging, unselect 'Stop at First Line'. If you don't, especially when you're trying to debug something as big as MyBB, it will trigger an invisible breakpoint at the first line of every single php file.
5) Create a New Project in NetBeans, Category:PHP > PHP application with Existing Source
6) Place breakpoints as needed.
7) Click Debug > Debug Project (or CTRL+F5)
8) Profit
01-03-2016 09:30 PM
Find all posts by this user Quote this message in a reply

« Next Oldest | Next Newest »

 Standard Tools
Forum Jump: