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

Derick Rethans:
The Mystery of the Missing Breakpoints
Dec 21, 2018 @ 16:32:53

Derick Rethans has shared a post on his site with an experience he had with a mystery of missing breakpoints and some issues he commonly is asked about regarding Xdebug's breakpoint functionality.

Occasionally I see people mentioned that Xdebug does not stop at certain breakpoints. This tends to relate to multi-line if conditions, or if/else conditions without braces ({ and }).

f you set a breakpoint at either line 7, 11, or 12, you'll find that these are ignored. But why is that?

To help explain, he uses the vld tool to show the opcode behind the language's processing. In its results you can see that a EXT_STMT code is missing for the lines where the breakpoints were set. Xdebug doesn't see the marker it's expecting so the breakpoint isn't recognized and execution isn't halted as expected. He offers some suggestions you can use of other tools and functions to make sure the location you've selected can actually accommodate a breakpoint.

tagged: missing breakpoint xdebug tutorial opcode tutorial

Link: https://derickrethans.nl/breakpoints.html

php[architect] Podcast:
Episode 12 - Whole lot of Xdebug
Sep 10, 2018 @ 14:19:23

The php[architect] podcast, hosted by PHP community members Eric van Johnson and John Congdon, has posted their latest episode: Episode #12 - Whole lot of Xdebug

Our twelfth episode is in the can, thanks to Eric van Johnson and John Congdon. Eric and John discuss freelancing and how it changed John’s life, regular expressions, PhpStorm, and how the PHP community gets together. [Their guest] Oscar talks about trying to use Xdebug regularly and the value of debugging tools in general [and there's an] interview with Mark Niebergall on his Xdebug article, his day to day work, and working remotely.

You can listen to this latest episode either using the in-page audio player or by downloading it directly. If you enjoy the show, be sure to subscribe to their feed to get updates when new shows are released.

tagged: podcast phparchitect ep12 xdebug freelancing remote work

Link: https://www.phparch.com/podcast/episode-12/

CodeWall:
Debug PHP with XDebug on NetBeans
Sep 06, 2018 @ 14:35:21

On the Codewall.co.uk site they've posted another tutorial that will help you set up a part of your PHP development environment: XDebug and the IDE NetBeans.

NetBeans is a fantastic free IDE for not just PHP, but other languages like HTML, JavaScript, C++ and more. For PHP it comes highly prepared for being your predominant development environment. It has a whopping list of features that turbo-charge your programming like it’s auto-complete ability to name just one. A PHP development environment isn’t complete unless you have the power to debug the code you write, in this tutorial, you’ll learn how to correctly set that up.

After covering some of the prerequisites they break down the process into a few steps:

  • Download XDebug
  • Configuring XDebug in the PHP.ini file
  • Checking configuration has been activated
  • Configuring NetBeans to use the xDebug module

The last step in the process is an example of actually running the debugger and debugging some code with a breakpoint (and the resulting output)

tagged: tutorial ide netbeans xdebug debugging environment development

Link: https://www.codewall.co.uk/debug-php-with-xdebug-on-netbeans/

Pascal Landau:
Setting up PhpStorm with Xdebug for local development on Docker
Aug 08, 2018 @ 17:44:30

Following up from his previous post about setting up Docker running PHP-FPM and Nginx on Windows 10, Pascal Landau has published the second part of the series taking things a step further and introducing (and integrating) PhpStorm and Xdebug for local development debugging.

In the second part of this tutorial series on developing PHP on Docker we're taking a good hard look at PhpStorm, Xdebug and how to run and debug scripts from within PhpStorm on Docker.

[...] The setup that I am going to use is for demonstration purposes only! I do not recommend that you use it "as is" as your development setup. [...] There will be a another part of this series that will deal with all of those (and some more common) problems and aims at providing a consistent development environment for all developers in a team (regardless of the OS they are using).

He then walks through the process from setup through actual script debugging:

  • setting up the Docker containers/configuration
  • allowing the PHP container to connect over port 2375
  • running a PHP script on this container
  • building a "workspace" container for Xdebug

For each step he provides the configuration changes needed, commands and screenshots of the settings panels to ensure its easy to follow along.

tagged: docker phpfpm nginx debugging phpstorm xdebug tutorial series part2

Link: https://www.pascallandau.com/blog/setup-phpstorm-with-xdebug-on-docker/

CodeWall:
Debug PHP In VSCode With XDebug
Jul 25, 2018 @ 16:48:13

On the CodeWall site there's a tutorial posted showing the VS Code users out there how to set up debugging with XDebug for your PHP-based projects.

VSCode is great, the fact that it can work with a vast amount of languages help’s it cater for everyone’s taste. One special tool that comes with VSCode is the Debug feature and when configured correctly, is a dream to use. If you’ve previously worked with Visual Studio 2017 for example, you will know what I mean. This guide will go through how to set-up the PHP xDebug module to work in tandem with VSCode, completely enabling full-on functional debugging across your application.

The tutorial is broken into a few main sections: getting the basics ready, configuring the editor and an example of it in use. It provides screenshots of the editor as it goes along and links to other helpful resources (like the XDebug Chrome helper) to make the process as painless as possible.

tagged: tutorial xdebug vscode debugging setup installation configuration

Link: https://www.codewall.co.uk/debug-php-in-vscode-with-xdebug/

Derick Rethans:
Xdebug 2.6
Jan 31, 2018 @ 16:45:10

On his site Derick Rethans, lead on the Xdebug project, has posted about the release of the latest version of the popular PHP debugging tool: Xdebug 2.6.

I have just released Xdebug 2.6. Xdebug 2.6 adds supports for PHP 7.2 (and drops support for PHP 5), and adds a whole bunch of new features. This article describes these new features.

Among the items he details are changes around:

  • Garbage Collection Statistics
  • Profiler Enhancements
  • Remote Debugging Improvements
  • Behavioural Changes

There are also some smaller improvements in the output of the tool allowing for custom filenames, superglobal details and the inclusion of assign-by-reference assignments. You can find out more about this latest version and get the latest from the main Xdebug site. If you'd like to show appreciation for all the hard work Derick has put into the tool, you should consider becoming a patron to show your support.

tagged: xdebug debugging tool release v26 announcement derickrethans

Link: https://derickrethans.nl/xdebug-26.html

Laravel News:
Learn how to set up Xdebug for PhpStorm and Laravel Valet
Aug 10, 2017 @ 17:48:41

On the Laravel News site there's a post sharing a guide (and a screencast) that helps you set up XDebug and Laravel Valet to work with PHPStorm for debugging your code.

I’ve been developing web applications for about 15 years, but somehow Xdebug is still challenging to set up. Follow along and learn how to find Xdebug settings and configure it for local development with PhpStorm.

If you are using PHP-FPM locally, you might have run into an annoying issue that no matter what you do Xdebug won’t work! I might have an answer for you in this video.

The video, viewable either in-page or on YouTube directly. It's about 15 minutes long and provides you with the prerequisites, commands to get everything set up and the configuration changes to make to the PHP config and PHPStorm to get them working together.

tagged: laravel valet xdebug tutorial screencast tutorial

Link: https://laravel-news.com/xdebug-phpstorm-valet

Delicious Brains Blog:
How to Use Xdebug for Advanced PHP Debugging
Aug 07, 2017 @ 15:17:14

On the Delicious Brains site there's a tutorial posted that shows you how to use XDebug for advanced PHP debugging versus some of the usual practices of var_dump or print_r-ing your way through your testing.

You could just debug your PHP code using functions such as error_log, print, and var_dump, (and to be honest we’ve all done it, a lot!), but sometimes they just aren’t enough, and can actually slow you down while developing.

There must be a better way, surely?! Enter Xdebug, the rather awesome debugging and profiling tool for PHP.

In this post, I’ll take you through why Xdebug is amazing, getting it setup, how to use it, get the most out of it it, and some neat advanced uses all to make your life easier.

He starts with some background on his previous debugging practices and how discovering XDebug revolutionized his workflow. He then talks about breakpoints for debugging and what he calls "debug driven development". The article then walks you through the installation process and the integration with IDEs, specifically PHPStorm. The rest of the post shows examples of how to use XDebug along with breakpoints and IDE features to get more information about the current application state and where things are failing. He also includes sections about using XDebug for profiling and performing remote debugging via an SSH tunnel.

tagged: xdebug introduction debugging profiling tutorial setup ide integration

Link: https://deliciousbrains.com/xdebug-advanced-php-debugging/

Derick Rethans:
15 years of Xdebug
May 10, 2017 @ 15:27:14

In a recent post the fifteenth anniversary of the XDebug PHP debugging tool was celebrated and lead developer Derick Rethans was presented with several tokens of appreciation from the PHP community. In this new post to his site he shares the experience (it was a surprise after all) from his perspective and thanks those involved.

This article was going to be about some upcoming features in the 2.6 release. Or rather, I was hoping to announce at least a beta release of Xdebug 2.6. Unfortunately, I couldn't find enough time to work on all the issues that I wanted, although I've made a little progress.

What I can write about, is a little mystery.

He talks about the initial invite from James Titcumb to meet him at his favorite whisky store and the eight special bottles that the community purchased to show their appreciation for his hard fifteen years of work on this invaluable tool. He lists out the types for those interested and some of the messages from contributors showing their appreciation. He thanks all of those involved.

And on the Xdebug front, there are plenty of bugs to fix, features to add for Xdebug 2.6, and undoubtedly Dmitry will be "breaking" some things in PHP 7.2 that I need to support in Xdebug as well.
tagged: fifteen years anniversary derickrethans xdebug debugging tool project whiskey

Link: https://derickrethans.nl/xdebug-15.html

Cal Evans:
Thank you Derick Rethans for 15 years of XDebug
Apr 27, 2017 @ 14:38:58

Recently the Xdebug PHP debugging tool turned 15 and PHP community member Cal Evans wanted to do something special for the author, Derick Rethans. He started a secret fundraiser to gather contributions from all around the community and used the funds to purchase Derick several bottles of his favorite beverage. In this new post to his site Cal shares some about XDebug, Derick and a video of James Titcumb presenting Derick with his present.

There are a handful of tools that have actually changed how many of us code PHP. XDebug is one of those tools[1]. There is no doubt of the impact that XDebug has has on PHP developers and PHP projects.

Recently, XDebug turned 15. This means that the man responsible for XDebug, Derick Rethans, has been supporting XDebug for 15 years, for free. [...] So on this the (close to) anniversary of this product, many of us in the PHP community decided to do something to show Derick how much we appreciate it. Those that know him know that Derick loves a good Scotch. So we decided to buy him some.

Cal has the video embedded in the post (or here on YouTube) and offers thanks to the people and groups that helped to make the project successful.

tagged: celebrate xdebug fifteen years derickrethans gift donation

Link: https://blog.calevans.com/2017/04/26/thank-derick-rethans-15-years-xdebug/


Trending Topics: