News Feed
Sections




News Archive
feed this:

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

SitePoint PHP Blog:
Debugging with Xdebug and Sublime Text 3
February 28, 2014 @ 11:10:53

The latest post from the SitePoint PHP blog, a new tutorial by Peter Nijssen, shows you how to get started with Xdebug and Sublime Text 3 to debug your PHP applications.

Debugging - we all do it a lot. Writing code perfectly the first time around is hard and only a few (if any) succeed at it. More than a year ago, Shameer wrote an article on SitePoint about how you can debug your application using Xdebug and Netbeans. In this article, we are going to have a look at how we can debug using Xdebug in combination with Sublime Text.

He assumes you already have Xdebug installed (and links to the instructions for those that don't) and helps you configure it to find your listening editor. Back in Sublime, he shows you how to use the package manager to install the Xdebug client and configure the current project to use it. He shows how to set up breakpoints and view the stack/watch data when the point is hit.

0 comments voice your opinion now!
debug xdebug sublimetext remote tutorial package client

Link: http://www.sitepoint.com/debugging-xdebug-sublime-text-3/

Dutch Web Alliance:
The definitive remote debug and unittest with PHPStorm guide part 6
January 09, 2014 @ 11:20:28

The Dutch Web Alliance has posted the sixth part of their series helping you debug/unit test your applications with PHPStorm and Xdebug. In this new post they focus on working with command-line applications.

So there is already a lot covered: debugging web applications, testing your units, getting code coverage. But one thing that remains is trying to debug your command line applications. Even today more and more applications aren't built for primarily the web, but for other purposes or many web frameworks have some kind of "console" component which allows you to easily create command line tools that deals with asynchronous handling of data, or just mere as cronjobs.

They walk you through the steps you'll need to be sure everything it set up correctly for PHPStorm to catch the debug calls:

  • Ensuring Xdebug is active
  • Validating that PHPStorm is listening for incoming requests
  • Configuring Xdebug on where to connect
  • Setting up the mapping for paths inside PHPStorm
0 comments voice your opinion now!
xdebug phpstorm unittest debug tutorial series part6 commandline

Link: http://dutchweballiance.nl/techblog/the-definitive-remote-debug-and-unittest-with-phpstorm-guide-part-6/

Dutch Web Alliance:
The definitive remote debug and unittest with PHPStorm guide part 5
December 24, 2013 @ 13:09:05

The Dutch Web Alliance has posted the fifth part (of seven) of their series looking at configuring the PHPStorm IDE to remotely debug and run your unit tests. In this article they focus in on getting coverage information from the tests and generating the reports.

They walk you through all of the terminology and configuration you'll need to get things working. They include an example of a Closer coverage configuration file (XML) to push the results out where PHPStorm can grab them. They show show the result (screenshot) of the coverage results being shown inside the IDE.

This is part five of the series, so if you'd like to get caught up check out the full table of contents for links to all of the posts so far.

0 comments voice your opinion now!
remote debug unittest code coverage clover report series tutorial

Link: http://dutchweballiance.nl/techblog/the-definitive-remote-debug-and-unittest-with-phpstorm-guide-part-5-2/

Dutch Web Alliance:
The definitive remote debug and unittest with PHPStorm guide part 4
December 20, 2013 @ 09:52:28

The Dutch Web Alliance has posted the fourth part of their series looking at remote debugging with PHPStorm. If you want to start from the beginning, you can find the first part of the series here (along with a table of contents for the other parts).

Unit testing should play a pretty big part in your daily PHP work. With the help of PHPUnit, writing and executing those tests is fairly simple. But in a remote environment we run into some issues which we try to solve in this blogpost. I'm not going to tell you the basics of unit-testing, as we assume you already are familiar with this. If not, There are lots of blog posts on this subject.

With some tests already in place, they show you how to get PHPStorm all set up and working. First they talk some about how the IDE makes its connection to the remote server via a "proxy" script. There's a few problems with this method, so they show a different approach using the "PHP on Server" configuration setting. They walk you through the setup of this feature (with screenshots) and how to "trick" it using a dummy phpunit.xml file.

0 comments voice your opinion now!
unittest phpstorm series remote debug guide part4

Link: http://dutchweballiance.nl/techblog/the-definitive-remote-debug-and-unittest-with-phpstorm-guide-part-4/

JetBrains.com:
Just-In-Time debugging and PHP Exception Breakpoints with PhpStorm and Xdebug
December 19, 2013 @ 09:30:59

On the JetBrains site there's a recent post showing you how to use just-in-time debugging and breakpoints in their PHPStorm IDE combined with the popular PHP debugging tool Xdebug.

In every project comes a moment where code stabilizes and we don't want to keep the debugger attached to our code all the time. Or maybe we just want to run our code and only attach the debugger when an error occurs or an exception is thrown. Meet Xdebug's just-in-time (jit) mode and PHP Exception Breakpoints in PhpStorm!

This feature makes use of the "jit" setting for the "remote_mode" setting that Xdebug offers to only send debugging information back to the remote debugger with an error occurs. They show you how to set up PHPStorm for these debugger connections and some example screenshots of it in action. The breakpoints feature compliments this functionality by allowing you to set breakpoints on which kind of errors you want to see information about (ex. warning, notice or deprecated issues).

0 comments voice your opinion now!
phpstorm debug exception xdebug justintime remotemode breakpoint

Link: http://blog.jetbrains.com/phpstorm/2013/12/just-in-time-debugging-and-php-exception-breakpoints-with-phpstorm-and-xdebug/

Sameer Borate:
Easy PHP debugging with Kint
November 07, 2013 @ 11:24:02

Sameer Borate has posted about using Kint, a "more powerful debugger" that lets you output more data than just the usual var_dump or print_r provides and in a much more readable format.

My standard debugging tool when using PHP is xdebug. Pairing xdebug with Komodo gives me a very productive environment for building PHP applications. However, testing an application code on a hosted server can be many times frustrating as one has only the print_r and var_dump functions at our disposal. What I need is a library that I can easily install on the server and start using. Although there are a few debugging libraries around, one of my favorites is Kint.

He walks you through the installation of the tool and provides an example of the most basic usage (and output) from a call to the tool's "dump" function. He also gets into some of the additional features the library provides including intelligent formatting, debug tracing and limited theme configuration.

0 comments voice your opinion now!
debug kint output printr vardump example setup

Link: http://www.codediesel.com/tools/easy-php-debugging-with-kint/

Qandidate.com:
Debugging PHP applications with HHVM
October 30, 2013 @ 11:10:23

On the Qandidate.com blog there's a new post showing you an easy way to debug HHVM applications via the built-in debugging tool and it's command line interface. The HHVM is the virtual machine version of the HipHop compiler Facebook created to speed up PHP execution.

In the previous parts of this series we got you started with HHVM and showed how we could get the symfony standard edition running on HHVM. This time we will dive deeper into HHVM by using it to debug our application. For most people the easiest way of debugging a PHP application is to place var_dump() and die() statements all over the code. Another option is installing xdebug, which has gotten a lot easier nowadays due to IDE integrations.

To illustrate, they create a super simple PHP script and show how to start up the HHVM in debug mode. They introduce you to the commands you'll need to step through the script execution and locate the breakpoints where errors are happening. You can do things like print out the current values of variables, set conditional breakpoints and get a stack trace for the execution so far.

0 comments voice your opinion now!
debug hhvm hiphop virtualmachine tutorial introduction

Link: http://labs.qandidate.com/blog/2013/10/29/debugging-php-applications-with-hhvm/

Project:
PHP DebugBar - In-browser Profiling Data for PHP Applications
August 13, 2013 @ 12:32:44

There's a handy feature in the Symfony framework that provides a "debug bar" with information about the execution of your application. But what if you don't use Symfony for your development? Enter PHP DebugBar. This handy tool is easily installable via Composer and has lots of useful features including:

  • Output of messages to the (Javascript-based) console
  • Viewing exceptions
  • Profiling database requests
  • Showing an execution timeline
  • Outputting the contents of the "request" (like superglobals)

It does all this completely independent of any other tool, so it's ready to drop into your application and go. You can find out more about the tool on the main project site or, if you'd like to contribute, you can find the project on Github.

0 comments voice your opinion now!
debug browser interface project tool

Link: http://phpdebugbar.com

Adam Culp:
XHProf PHP Profiling
August 05, 2013 @ 09:03:35

Adam Culp has posted to his site about some of his experiences with XHProf and profiling his PHP applications.

Today I set up my development environment so I can use XHProf to profile PHP scripts when needed, and it was pretty easy. [...] XHProf is a PECL package, and can be easily installed by using standard PECL commands.

He walks you through the installation of the PECL package (you'll need to use the command line for this one) and how to add the module to your php.ini to enable it. Once you restart your web server, you can start the debugging using the xhprof_enable function and then the xhprof_disable function to end the testing and retrieve the data for processing. He also includes a bit of output from his own pass-through script to show the results.

0 comments voice your opinion now!
xhprof profiling install tutorial debug

Link: http://www.geekyboy.com/archives/718

PHPMaster.com:
Inattention Blindess - Missing the Obvious
June 25, 2013 @ 12:19:08

On PHPMaster.com today there's an interesting article about something called "inattention blindness" - basically, the situation that comes up when you can't seem to find an issue/bug yet it's completely obvious to someone else.

Your code isn't working! You don't know why and you've been staring at it for what seems like hours. You're grumpy. You're falling behind schedule. You're getting increasingly irritated. Why doesn't it work? Why can't you see the bug? It can't be so hard to find, can it? Out of sheer frustration (as opposed to rational thought) you call over a coworker to help you find the problem. Within seconds they do what's been seemingly beyond you - they identify the source of the issue. To make matters worse, it's painfully simple. [...] Inattention blindness is a phenomena related to people's perception of the data they receive through their senses.

The talks about the invisible gorilla test and four theories that might cause the person to miss the obvious. He then relates this back to programming, pointing out a few reasons you might "miss the gorilla" when it comes to debugging your code:

  • Specific Language Experience / Programmer Expectations
  • Operator Overloading
  • Syntactic Noise
  • Whitespace - Vertical and Horizontal
0 comments voice your opinion now!
inattention blindness debug code development gorilla

Link: http://phpmaster.com/inattention-blindess-missing-the-obvious


Community Events





Don't see your event here?
Let us know!


release api symfony library language series package laravel opinion interview podcast tips list update deployment install framework introduction zendserver community

All content copyright, 2014 PHPDeveloper.org :: info@phpdeveloper.org - Powered by the Solar PHP Framework