Xdebug
Xdebug is an extension for PHP that provides both debugging and profiling information for PHP scripts. Xdebug displays a full-stake trace information for errors, including function names, line numbers, and filenames. Also, it provides the ability to debug scripts interactively using different IDEs, such as Sublime Text, Eclipse, PHP Storm, and Zend Studio.
To check whether Xdebug is installed and enabled on our PHP installation, we need to check the phpinfo() details. On the phpinfo details page, search for Xdebug, and you should see details similar to the following screenshot:
This means that our PHP installation has Xdebug installed. Now, we need to configure Xdebug. Either the Xdebug configuration will be in the php.ini
file, or it will have its separate .ini
file. At our installation, we will have a separate 20-xdebug.ini
file placed at the /etc/php/7.0/fpm/conf.d/
path.
Note
For the purpose of this book, we will use the Homestead Vagrant box from Laravel. It provides complete tools...