Joomla! CMS is platform for website development which is using by quite a large number of people today. I have started using this few years back and contributed in many ways. Every time a development is going on, we came across situations where we need to look in to variables’s instance values. In some situations I just print that variable value. However in complex situation a help of a debugger is essential. There are several methods to debug Joomla during development process and most of them are mentioned in this reference article . In this article I am describing one of those method in detail.
In my case I had the following setup;
- Joomla CMS installed
- Phpstrom on Windows
- XAMPP which runs Apache and SQL
Now it’s time to start setting up.
Configuring XDebug on XAMPP
- Download xdebug library suites for php version and OS (https://xdebug.org/download.php)
- Put the library in php/ext folder
- Add Xdebug configuration to the end of php.ini file
- Add desired host and port
- Restart XAMPP server and check phpinfo to verify xdebug section
Sample Xdebug configuration for php.ini file . “zend_extension_ts” is the path to locate downloaded library.
zend_extension = “c:\xampp\php\ext\php_xdebug-2.5.5-7.1-vc14.dll”
xdebug.remote_autostart = 1
xdebug.profiler_append = 0
xdebug.profiler_enable = 0
xdebug.profiler_enable_trigger = 0
xdebug.profiler_output_dir = “c:\xampp\tmp”
;xdebug.profiler_output_name = “cachegrind.out.%t-%s”
xdebug.remote_enable = 1
xdebug.remote_handler = “dbgp”
xdebug.remote_host = “127.0.0.1”
xdebug.remote_port = 9000
xdebug.trace_output_dir = “c:\xampp\tmp”
; 3600 (1 hour), 36000 = 10h
xdebug.remote_cookie_expire_time = 36000
Configuring Web Browser
- Install xdebug-helper extension in chrome browser  (there are other extensions for other browsers such as Firefox)
- Go to extension options and change IDE key to PHPSTROM
- Once you are logged to Joomla, switch to the Debug mode of plugin
Configuring Joomla to debug
Go to Global Configuration -> System and enable Debug System
There are several ways of configuring remote debug from IDE side. Here I discuss on setting up as a remote debugger.
- Go to debug configuration
- Click + sign and click remote debugger
- Click servers and add server’s debug configuration (xdebug host and port)
- Add the correct IDE key and start debugger
- Put some breakpoints and perform some actions Joomla!
There are several other ways of debugging Joomla as mention in . Depending on the operating system, IDE and other facts, you may need to use different options. I believe this article may help you to quickly setup debugging for Joomla! developments.
 How to debug your code – https://docs.joomla.org/How_to_debug_your_code
 Edit php.ini for XDebug – https://docs.joomla.org/Edit_PHP.INI_File_for_XDebug