PHP is one of the most widely used scripting language. When compared to other languages; PHP has an easy learning curve, a clear documentation, availability of code editors,tools and scripts. All these make developers adopt PHP for web development needs. The community for PHP is very big which helps you in getting answers for your queries.
In spite of the tools, scripts and support available; hand coding PHP and getting web development done is not a simple task. Certain mistakes will crawl in during the process of web development. For example, missing a simple semi-colon in a loop can affect the entire loop. Finding mistakes or errors consumes a lot of time and effort. This process is known as debugging. In order to make this process simple, there are a number of PHP debugging tools available. These PHP debugging tools when used help developers in debugging the PHP code and thereby increases the productivity of a developer.
List of the best php debugging tools
Hence, we have compiled a list of some of the best, free, open source and premium PHP debugging tools that will help a developer in the process of debugging PHP code. The list is sorted out alphabetically and not on the basis of any other criteria
With the help of DBG, developers can debug the scripts locally or remotely from an IDE or console. It is a full featured PHP debugger and interactive tool which helps in the process of debugging PHP scripts on a production and/or development web server.
Kint – Modern and powerful PHP debugging helper
Kint is extremely simple and easy-to-use. The tool provides a number of features that will help a developer in debugging the PHP code. Hence it is a go to destination for the PHP developer.Some of the various features provided by Kint are:
- Easy to install and use
- The content is displayed in a simple and easy to understand format
- Kint provides the developers with the ability of finding out error exactly. Hence there is no need of searching for a particular error. It presents the name of variable or expression being passed, the file and the line from where you have called the dump function and the function/method containing the call.
- The tool acts as an easier replacement for var_dump(), debug_backtrace() which are used in the process of debugging
- You can customize the way Kint looks with the help of themes.
print_r() and var_dump() are being used by many of the PHP developers in the process of debugging PHP code. Krumo presents the debugging information in a simple and beautiful way using CSS and DHTML. It prints the code line that the Krumo call was placed thus helping developers keep a track of the origin of each dump seen on the screen. With one simple call, you can see list of included files, declared classes and interfaces or defined constraints in an easy, fast and graceful way.
Macgdbp provides effective features like three stepping controls, breakpoints etc., which makes debugging on live and running PHP applications easy. The tool provides function stack as well as the local variables. The function stack allows to see the call path of the current point of execution. The list of local variables allows in inspecting variables which include arrays and object properties to see their type and what type of value it is.
Being an open source project, PHP_Debug provides information about program trace, variables, display, process time, included files, executed queries at the end of the script in a readable format using a nice floating div or html table. The tool has been developed to provide the basic needs of debugging and to assist developers in the process of debugging PHP code.
PHP Debug Bar
Debugbar is an opensource php debugging tool which has a clean, fast and easy to use interface without any dependancies. It can be easily integrated in a project, handles Ajax requests and displays profiling data from any part of the application.
PHP Debugger helps in debugging PHP code faster, eliminates errors and is considered to be one of the best PHP debugging tools.
It provides a powerful and easy way to simplify debugging by giving a complete visibility and control over the execution og PHP scripts. With the help of this tool, you can set up remote debugging in PHPED with the help of PHP settings wizard and DBG wizard in the tool.
PHP_Dyn is an open source PHP extension developed in order to assist developers in the process of debugging PHP scripts. The extension helps developers in getting the execution trace of scripts without modifying PHP script.
PHPMD – PHP mess detector
PHPMD is a spin-off project of PHP Depend and aims to be the equivalent to the Java tool PMD. The tool takes the given PHP source code and identifies problems which include possible bugs, suboptimal code, over complicated expressions, unused parameters, methods and properties. It is user friendly, easy to configure and provides raw metrics which are measured by PHP Depend. The tool is still young and provides limited set of pre-defined rules when compared to PMD.
Pinba is not exactly a php debugging tool since its usage is not supported to debug anything on production servers. The tool accumulates and processes data sent and displays statistics in the form of simple reports which can be easily read. The open source project helps developers in monitoring the performance of PHP scripts. It helps in locating the problems and getting the attention towards them.
Designed to perform quick and dirty optimizations, Webgrind is an Xdebug profiling web front end in PHP5.With the help of webgrind, you can track the time spent on functions by self cost and inclusive cost. The tool works on all platforms, installs in seconds and provides a subset of the features of kcachegrind.
Whoops has been developed with an intention to decrease the pain in handling errors and exceptions during debugging PHP code. It has a simple API with the help of which this can be easily integrated into any framework. Whoops has a good looking error interface and the library provides stack based error handling. It is a nice little library which helps developers in developing and maintaining the projects better.
Xdebug, an open source PHP extension is easy to use and requires minimal set up. The extension plugs into many of the popular PHP applications and provides a ton of useful information (data on stack traces, function traces in error messages with display of full parameters for user defined functions).
The above are some of the best php debugging tools which will help developers to debug php code. If we have missed out any or if you’ve something to say about the above tools, please do let us know through comments.