Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

I need to debug PHP. What is my best choice?

I'm working on a web site under a Linux environment (Debian). I'm not an expert at Linux but I can handle it, and the website is made using PHP, MySQL, HTML, etc.

The thing is, I'm using PHP for the server side. Right now, for testing, I installed Apache on my PC so I can test everything. But, it would be great if I could debug the PHP code. So far, I didn't need it, but now the code is getting larger, it's a must.

So far, I'm using vim and everything is fine, but, how can I debug PHP in my case? What tools should I install? Are they free?

Basically, I need to know what would be the best choice in my situation.

like image 801
Artemix Avatar asked Jan 09 '11 16:01

Artemix


People also ask

What should I debug PHP with?

A: You can debug PHP code in Firefox using multiple debugging tools. Firefox provides an extension for popular PHP debugging tools including FirePHP, Xdebug, Firebug, and others.

What is your most preferable approach while debugging PHP code?

The best and more user-friendly way of debugging most of the people prefer if they are using an IDE for coding is using XDebug. XDebug is a PHP extension that helps in the development and debugging and provides a single step debugger that you can use with an IDE like PHPStorm.

What is debug mode in PHP?

In this debugging mode, PhpStorm fully controls the debugging process: it launches the application, opens the browser, and activates the debugging engine according to a PHP Web Page debug configuration.

Does PHP have a debugger?

About debugging in PHP ¶PHP is shipped with the phpdbg interactive debugger. External debuggers can also be used. The » Zend IDE includes a debugger, and there are also some free debugger extensions like DBG at » http://www.php-debugger.com/dbg/, the » Advanced PHP Debugger (APD) or » Xdebug.


1 Answers

XDebug provides step-by-step debugging, and can be used with eclipse PDT, netbeans and even vim. You really should give it a try. There also is Zend Debugger.

like image 143
greg0ire Avatar answered Sep 28 '22 07:09

greg0ire