Looking for more information on how to do PHP the right way? Check out PHP: The Right Way

Joe Watkins:
Preface to idbg
Jun 13, 2018 @ 11:54:35

Joe Watkins has a post on his site sharing a project he has been working on to create a debugger for PHP applications that can be installed easily and understood by those already having knowledge of PHP.

We already have several options for debugging code within the PHP ecosystem. XDebug is extremely mature software, and phpdbg has been slowly gaining traction also, if for no other reason than it's very fast to collect code coverage compared to XDebug.

[...] Debugging is a necessary part of writing code; If you disagree with this statement, then I don't know what you are talking about. [...] Using a debugger is like having an army of nano bots at your disposal, each one trained exquisitely in a top nano-bot-training-camp, they live to kill cockroaches, some of them also have mean looking tattoos, chew tobacco, and spit on the ground at the start of every sentence ...

He goes on to talk about why he made the choice to write the debugger with a PHP interface. He then gets into some of the specifics of debugging needs and links to the krakjoe/inspector repository for the tool. The README has more information about the interface and functionality than the blog post does, so if you're interested to read more, head over there.

tagged: debugger idbg introduction opcode library project

Link: http://blog.krakjoe.ninja/2018/06/preface-to-idbg.html

TutsPlus.com:
Programming With Yii2: Using the Debugger
Jan 03, 2017 @ 11:52:29

The TutsPlus.com site continues their "Programming with Yii2" series of tutorials with the latest edition in the series, a look at using the Yii2 debugger to help track down issues in your code.

In today's tutorial, I'll show you how to install the Yii2 Debugger, and we'll explore its capabilities in detail. It's a powerful programming assistant which is often underutilized.

As you code and test your application, the debugger can show you your application path, queries and query variables, performance characteristics, server and framework settings, and much more.

The article starts off by showing you how to install the "yiisoft/yii2-debug" library (via Composer) and enable it in the "debug" section of your configuration. With it correctly installed you'll then be able to access it at the bottom of your pages. The debug console provides plenty of helpful information related to:

  • the route matched
  • a log of actions and events
  • load time
  • memory used
  • database queries performed

...among others. The tutorial walks you through these and other pieces of information the tool provides with screenshots of example output for each.

tagged: programming yii2 debugger tutorial series toolbar screenshot detail

Link: https://code.tutsplus.com/tutorials/programming-with-yii2-using-the-debugger--cms-26910

Zend Developer Zone:
A Reverse Debugger for PHP…wait…WHAT?
Nov 16, 2016 @ 11:51:28

On the Zend Developer Zone they have a post talking about an interesting project - a reverse debugger for PHP making it simpler to step forward and backwards through breakpoints in your PHP code (instead of just forward).

Honestly, when I originally tweeted this out I really wasn’t 100% sure what it did. You never know when you see things like “reverse debugger”. It’s one of those “I understand the words separately…” type of things. Then I watched the short video. HO-LY CRAP! Seriously, it is exactly what it says, it allows you to step debug forward AND backwards. Well, almost. You have to record the session first and then you can step forwards and backwards. Still it is a powerful tool.

The project, Don'tBug, hooks directly into any IDE that supports XDebug (just about all of them) making it easy to integrate into your current workflow. You can see it in action in this video over on YouTube.

tagged: reverse debugger language tool dontbug project xdebug

Link: https://devzone.zend.com/7400/reverse-debugger-php-wait/

Allan MacGregor:
Working with Psysh
Apr 14, 2014 @ 09:24:34

Allan MacGregor introduces you to Psych in his latest post today. Psysh is a runtime developer console, interactive debugger and REPL for PHP.

Psysh is actually more than a simple REPL it's also an interactive debugger; which means you can say goodbye to the endless barrage of var_dump() and die() statements. But do we really need another REPL for PHP, well honestly we could probably get by with the solutions currently available however Psysh has an extremely interesting Ace under the sleeve, it can also function as a realtime debugger.

He includes a few terminalcasts showing some of the commands Psysh offers from the expected output of variable value out to a handy link to the PHP documentation. An example of the useful object output is also included, enabling the showing of methods and properties.

tagged: psysh repl debugger console documentation debugger

Link: http://coderoncode.com/2014/04/03/working-with-psysh.html

Allan MacGregor:
Working with Psysh
Apr 14, 2014 @ 09:24:34

Allan MacGregor introduces you to Psych in his latest post today. Psysh is a runtime developer console, interactive debugger and REPL for PHP.

Psysh is actually more than a simple REPL it's also an interactive debugger; which means you can say goodbye to the endless barrage of var_dump() and die() statements. But do we really need another REPL for PHP, well honestly we could probably get by with the solutions currently available however Psysh has an extremely interesting Ace under the sleeve, it can also function as a realtime debugger.

He includes a few terminalcasts showing some of the commands Psysh offers from the expected output of variable value out to a handy link to the PHP documentation. An example of the useful object output is also included, enabling the showing of methods and properties.

tagged: psysh repl debugger console documentation debugger

Link: http://coderoncode.com/2014/04/03/working-with-psysh.html

Ruslan Yakushev's Blog:
How to enable Xdebug in WebMatrix
Feb 22, 2011 @ 13:09:23

Ruslan Yakushev has posted some quick instructions on how to get Xdebug, the popular PHP debugger, enabled in the recently released WebMatrix tool from Microsoft.

When WebMatrix is used to build or modify a PHP-based web application the debugging tasks can be greatly simplified if Xdebug extension is used. This post explains how to install and use Xdebug extension with WebMatrix.

It's a simple six-step process (complete with screenshots) that shows you how to enable it in your php.ini, test that it's working with a simple buggy script and configure both the location to the correct DLL file and an output directory to create cachegrind files.

tagged: xdebug webmatrix microsoft windows debugger cachegrind

Link:

Bence Eros' Blog:
Creating an interactive debugger for PHP
Jan 26, 2011 @ 08:53:48

Bence Eros has submitted a new post from his blog that looks at the method he came up with to create an interactive debugger for PHP. It's just a prototype/proof of concept that lets you execute PHP code in the browser (using eval - a little scary, I'll admit).

Last night I created a prototype for an interactive debugger for PHP without the need of any IDE-plugin. In this post I'm going to show what I found. Unfortunately you will need some time to put the environment together, but I think it's worth doing it. My target was to create a way how you can view and modify your variables manually at runtime, only by inserting one line code.

He does mention that, because of the settings he uses, the debugger can only be loaded from a different domain than the application which can be restricted a bit simpler (i.e. its own https or .htauth). His setup uses an Apache2 web server and a few PHP/HTML scripts to get the job done. In the end you'll have something similar to this for you to run your code in.

tagged: interactive debugger webbased tutorial apache2

Link:

Community News:
DBG Debugger Helper for Google Chrome Released
Dec 27, 2010 @ 13:56:34

Jeremy Cook sent in a new tip about a new debugging extension for Google Chrome that hooks into the DBG debugger to help you test your PHP applications - a DBG Debugger Helper (currently in version 0.0.0.1).

For those using the DBG debugger for PHP development, this minimal extension provides a convenient way to initiate debugging and profiling sessions. The most likely users will be anyone using Nusphere's PhpED. This commercial PHP IDE includes a robust, up-to-date, and full-featured DBG debugger. [...] Installation, configuration, and use is quick and simple. While you can configure the clienthost, port, and session ID entries of the Options dialog, this is not required.

The extension makes it as simple as one click to start and stop the debugging process that will watch round trip requests and catch errors to allow DBG to provide things like backtraces, work through the script step by step.

tagged: google chrome helper dbg debugger helper

Link:

HowToForge.com:
Installing PHP5 Debugger On OpenSUSE 11.3
Oct 19, 2010 @ 12:49:19

On HowToForge.com there's a tutorial on installing a PHP Debugger (xdebug) on an OpenSUSE linux install including PHP5 and Apache.

This tutorial shows how to install php5 debugger (xdebug) on OpenSUSE 11.3.

The steps of the process are super simple because of the "zypper" package manager:

  • Install the PHP5, Apache2 and PHP for Apache module
  • Download the latest Xdebug version and unpack it
  • Build Xdebug
  • phpize it to build the shared object
  • Update your php.ini file to add it in
tagged: xdebug install tutorial debugger zypper opensuse

Link:

Developer.com:
PHP Development Tools Improve in Eclipse Helios Update
Jun 29, 2010 @ 09:26:20

On Developer.com today there's a new article talking about some of the PHP-related improvements in the latest version of the PHP Development Tools (PDT) extension for Eclipse including template assistance and improved debugging.

Among the 39 projects included in Eclipse Helios is the PDT (PHP Developer Tools) 2.2 release. The PHP Eclipse project was first announced back in 2005, with version 1.0 coming in 2007. With the PDT 2.2 release, the project has continued to evolve with new features as the project's popularity has grown.

New features include a template content assist feature that will help make it easier for developers to get an application up and running quickly and better debugging support via a new inspection tool to help evaluate PHP expressions. The post also includes some quotes from Andi Gutmans of Zend on the progress PDT has made and some thoughts on one of its competitors, Netbeans.

tagged: pdt development tools eclipse ide release template debugger

Link: