Here are instructions on how to enable Xdebug with PHP.
-
Find out which PHP are you currently running and the
php.inithat is loaded. -
Run
pecl install xdebugand it should automatically install and enable it. (Ensure thepeclis from the same installation as yourPHPexecutable) -
The install above should autoenabled "xdebug.so" in y our
php.inifile, but you still need to add another line, like this:zend_extension="xdebug.so" xdebug.mode=debug -
Verify you have it installed by running
php -v, and you should see line like this:with Xdebug v3.1.3, Copyright (c) 2002-2022, by Derick Rethans -
Restart
httpdweb server if you are using thePHPthere. -
Install Xdebug Helper Chrome Extension and enable "Debug" mode.
-
Now you may reload your
PHPapplication on the Chrome browser.
NOTE: After enabled these settings, you should checkout PHPStorm IDE. It has excellent debugger that let you step through your code like an Ninja!