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

Dutch Web Alliance:
The definitive remote debug and unittest with PHPStorm guide part 7
January 29, 2014 @ 10:54:25

The Dutch Web Alliance has posted the seventh part of their series looking at getting remote debugging and unit testing working with PHPStorm, a popular PHP IDE. You can start at the beginning or just find the links to any other articles in the series you might have missed in the first post.

So, your unit-tests should be small, not doing much, taking one unit at a time to test. Overall, not much is around to actually debug. But on occasion, having the ability to actually stepping through the unit-tests can save you a headache or two! Debugging your PHPUnit scripts isn't really that hard. In fact, most of what we need to do, we already covered in the previous postings! Consider this: PHPUnit is nothing more than a PHP framework running from the command line interface. And since we already know how to debug applications from the CLI, it must be easy!

This is the last post in the series and is pretty short. It basically talks about setting breakpoints in testing and letting PHPStorm catch the issues. If you'd rather run them from the command line, check out part six for more details.

0 comments voice your opinion now!
debugging unittest remote phpstorm tutorial series part6

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

Dutch Web Alliance:
The definitive remote debug and unittest with PHPStorm guide part 3
December 11, 2013 @ 09:19:23

The Dutch Web Alliance has posted the latest part in their "remote debugging with PHPStorm" series (parts one & two are linked here) with part three. This time they focus on setting up Xdebug and configuring the connection in the IDE.

Let's start with probably the most important part of all: debugging your web applications. In this day and age, people still use var_dump() and die() to debug their application. A shame really, knowing that step-debugging through your code is made really easy with PHPStorm. Using var_dump() is very slow, error prone and you only get a small fraction of the context you need in order to debug correctly. And how many times did such a var_dump() hit your production environment?? Truth be told, implementing XDebug does need a little bit of work, but fortunately PHPStorm has made things super easy for us.

They don't go through the whole installation part of Xdebug - there's other guides for that - but do help you configure it correctly to work with a remote debugger in PHPStorm. They show you how to set various breakpoints and a "trick" to working with path mappings.

0 comments voice your opinion now!
phpstorm remote debugging unittest tutorial series part3

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

Dutch Web Alliance:
The definitive remote debug and unittest with PHPStorm guide
December 06, 2013 @ 11:48:38

On the Dutch Web Alliance site today they've kicked off a new series of posts looking to help you get the most out of the PHPStorm IDE for remote PHP debugging and unit testing your application.

PHPStorm is probably the best IDE when it comes to PHP development. [...] This multi-part guide will try and set up your systems in such a way that EVERYTHING you need to do when it comes to development gets explained so you can set your system up correctly, once and for all. Meet the "definitive remote debugging and unittest with PHPStorm guide". Even though PHPStorm always had many different ways of editing, syncing and deploying your scripts, it was not until PHPStorm 7 that we finally have an IDE that can work fully on a virtualized remote system. In the next couple of blog posts I will try and give you a tour on how to set up your systems so they actually work.

So far they've posted the first two parts of the series:

Keep tuned in to this post (or their feed) for updates to the series and new articles as they're posted.

0 comments voice your opinion now!
remote debugging unittest phpunit phpstorm guide series

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

NetTuts.com:
Xdebug - Professional PHP Debugging
August 29, 2013 @ 09:56:01

On NetTuts.com there's a new article introducing Xdebug, a powerful tool that can help you with debugging your PHP applications. It works by investigating what's happening "on the inside" and reporting it back to your debugger.

Well, technically, Xdebug is an extension for PHP to make your life easier while debugging your code. [...] But just imagine for a moment, as your applications evolve, you might get into the habit of sprinkling your code all over with little echos, var_dumps and custom debuggers. [...] The next question is: how do you debug in production? [...] Now lastly, have you ever wished to be able to step through your code, line by line, watch expressions, and even step into a function call to see why it's producing the wrong return value? Well, you should definitely dig into the world of professional debugging with Xdebug, as it can solve all of the problems above.

They walk you through the setup of a complete (MAMP-based) environment on an OSX installation. You'll also need Xcode and the command line tools to be able to compile Xdebug. They recommend installing Homebrew to make installing the needed tools easier. They use Homebrew to install the PHP 5.4 version of Xdebug which then compiles and outputs a shared module you can put in your PHP extensions directory.

On the other side of things, the article also helps you set up your IDE, in this case PHPStorm but it would work for lots of others - to accept the debug messages from the server. He includes a sample script with some calls to the Xdebug-enabled debugging functions and what kind of responses (with screenshots) you should see in your IDE.

0 comments voice your opinion now!
xdebug debugging extension homebrew mamp osx install tutorial

Link: http://net.tutsplus.com/tutorials/tools-and-tips/xdebug-professional-php-debugging/

Enrise Blog:
Debugging Your Web Application with TCPDump and Wireshark
December 14, 2012 @ 12:50:15

On the Enrise blog Tim de Pater has posted about a different sort of method for debugging your web applications - using a combination of Wireshark and tcpdump to monitor your application's input and output.

Everything is running great, until suddenly the monitoring is yelling, the load on several servers is rising, MySQL queries/second and the memcached commands/second going through the roof, Apache processes are higher than usual, and the website starts giving timeouts. Yes, that sucks. Of course you'll first check everything that comes up in your mind like logs, diskspace, swap, etc. But then you come to a point that you really have to dive into it to find the cause of this sudden problem. There are several ways of doing this. One way I learned the last time we were in this scenario is using tcpdump and Wireshark.

He gives you a brief "getting started" tutorial helping you get things set up - dumping the packets with tcpdump and sifting through the results with Wireshark. His examples are more specific to watching for memcache traffic, but it can easily be applied to more general kinds of requests. Screenshots are also included so you can be sure you're seeing the right kind of results.

0 comments voice your opinion now!
tcpdump wireshark debugging memcache application


Silver Lining Blog:
How to Enable XDebug in Windows Azure Web Sites
September 27, 2012 @ 11:53:50

On the Silver Lining blog (a MSDN Windows Azure related site), there's a recent post showing how you can enable XDebug on your Azure instance to help with debugging your application.

In this post, I'll cover how to run XDebug (including the profiler) in Windows Azure Web Sites. Enabling XDebug in Windows Azure Web Sites is as simple as enabling an extension. However, enabling an extension for the built-in PHP runtime is slightly different than doing so for a custom PHP runtime. I'll cover both scenarios here.

The post is broken up into two sections - one if you're just using the built-in PHP runtime that's already in the instance and another if you're using a custom one of your own. Changes to the configuration files and some screenshots of where to make the updates are included.

0 comments voice your opinion now!
xdebug enable windows azure tutorial debugging


Danne Lundqvist:
Using Xdebug in MAMP
September 18, 2012 @ 10:10:01

Danne Lundqvist has a new post today showing you how to install and use XDebug with MAMP, the popular all-in-one LAMP package for OS X.

MAMP is a full local server environment including Apache, PHP and MySQL in one package. Anyone feeling at home in *nix systems should feel at home using both OS X and MAMP. [...] As I have helped a few collegues setup Xdebug in MAMP I have discovered that a lot of developers don't do this as they don't know how simple it is. Even seasoned PHP developers use the old echo/die debugging techniques.

He includes all the changes you'll need to make to configuration files and makes a simple script you can use to test out that things are working. As his IDE of choice is PHPStorm, he shows how to set up the remote debugging to work and reply back as the script is executed.

0 comments voice your opinion now!
xdebug mamp tutorial install phpstorm debugging


Juan Treminio's Blog:
Xdebug and You Why You Should be Using a Real Debugger
July 05, 2012 @ 08:52:13

If you've been working with PHP for any length of time, you know that one of the issues the language has shows up when you're trying to debug your applications. Thankfully, as Juan Treminio points out, there's a better way - Xdebug.

Xdebug is a PHP extension that was written and is maintained by Derick Rethans. It provides debugging and profiling capabilities, although I'll be mostly focusing on the debugging aspects in this tutorial. With it you can set a breakpoint and pause the execution of a script to see the state of your application at that exact point, including what variables/objects have been instantiated and what their values are. Xdebug completely replaces the need to litter your code with echo, print_r() or var_dump() calls, and displays information on all variables, not just the one you passed.

He talks some about the current state of IDE/editor support for the tool and shows how to get it installed and your php.ini configured to use it. XDebug make it easy to turn on/off debugging thanks to a handy browser-based switch. He links to a bookmarklet you can use to make it a one-click operation. He includes the setup for using the debugging in PHPStorm, but it's pretty similar for most of the IDEs out there.

0 comments voice your opinion now!
xdebug debugging install configure ide bookmarklet


Markus Pullmann's Blog:
Remote Debugging in PHP with XDebug
February 17, 2012 @ 08:45:29

Markus Pullmann has a new post to his blog about setting up XDebug in your PHP installation to help you narrow down those elusive issues more quickly.

Debugging locally is a nice improvement to have no debugger at all, but in many situations there is the need to debug on production server, where the application is running on the web. There are different reasons for that, but the most important one for me is, that my local environment / installation is different from the one i have on servers in data center and bugs can be related to the environment.

He walks you through the installation and server-side configuration of XDebug first then shows how to install the Komodo Remote Debugging Client to help with multi-user debugging setups. He mentions setting up the debugging on the client/IDE side, but there's no specific instructions for any particular IDE - just how it works overall.

0 comments voice your opinion now!
debugging xdebug tutorial install configure proxy multiuser


Derick Rethans' Blog:
Remote Debugging PHP with a Firewall in the Way
August 26, 2011 @ 11:24:17

Sometime debugging PHP applications isn't as easy as just pointing your IDE directly at the server and starting to work. Derick Rethans has a new post talking about one such situation, remote debugging with a firewall in between you and the remote machine with XDebug.

The PHP debugging extension Xdebug has "remote" debugging capabilities for single-step debugging PHP applications. This works by setting your favourite IDE into listening mode and instructing Xdebug (with one of the handy browser extensions for example) to initiate debugging. [...] There could however be a firewall in the way that prevents Xdebug connecting directly to your IDE's IP address. That can be because the network you are on employs NAT. [...] In this case, there is no way Xdebug can connect to your IDE's IP address and port. Or is there?

His alternative requires SSH access to the remote machine - building a tunnel from your local machine to the remote server XDebug can use to get around the firewall. He explains the shell command to set up the tunnel and, a more graphical way, through the Putty ssh/telnet client. A quick call to "netstat" can tell you if things are working correctly or not. All that's left then is to point your XDebug to the port on the localhost and you should be good to go on debugging.

0 comments voice your opinion now!
debugging firewall tutorial ssh tunnel xdebug ide



Community Events





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


laravel introduction opinion framework threedevsandamaybe configure unittest developer code community symfony2 podcast series testing refactor interview install list language release

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