Starting with version 1.7, XAMPP includes the XDebug PHP debugger, but it needs to be configured for use. To do that, we will edit the "php.ini" file to configure XDebug. The "Loaded Configuration File" in the screenshot above tells you what "php.ini" file is being used. For Windows, this is normally "c:\xampp\apache\bin\php.ini".
Important note for Windows 7 & Vista users: As of August 2013 (XAMPP version 1.8.2), the file "php_xdebug.dll" that is included with XAMPP now works with Windows 7 & Vista. In some earlier versions of XAMPP, the distributed version of XDebug did not work correctly. The symptom of this earlier problem was that the Apache server would stop if this version of XDebug is loaded. To check that you are running the correct version of XDebug on your system, follow these instructions on the XDebug site.
We need to edit this file to configure XDebug as follows:
- Find the line "implicit_flush" and set it as follows:
implicit_flush = On
- Find the section called "[Zend]" and comment out all of the lines by putting a semi-colon (";") at the start of each line.
- Find the line: zend_extension = "c:\xampp\php\ext\php_xdebug.dll" and uncomment it out.
- Find the "[XDebug]" section and uncomment out all of the lines (except for the first comment line). For Windows, it should look like the example below:
[XDebug] ;; Only Zend OR (!) XDebug zend_extension_ts="C:\xampp\php\ext\php_xdebug.dll" xdebug.remote_enable=true xdebug.remote_host=localhost xdebug.remote_port=10000 xdebug.remote_handler=dbgp
You do not need to enable XDebug profiling to use XDebug to debug Joomla code. Profiling allows you to find performance bottlenecks in your PHP code. However, enabling profiling with XDebug can slow down your system substantially, so it is not recommended unless you need it. To enable XDebug profiling, add these entries to your php.ini file.
xdebug.profiler_enable=1 xdebug.profiler_output_dir="C:\xampp\tmp"
For Windows 7 & Vista, you will use the file downloaded from the XDebug site. So the first line will be
zend_extension_ts="C:\xampp\php\ext\php_xdebug-2.0.0-5.2.2.dll"
For PHP version 5.3 or later, the "_ts" has been dropped, so the first line will read
zend_extension="C:\xampp\php\ext\php_xdebug.dll"
In XAMPP 1.7.3 on Windows 7 (currently not verified/tested with prior Windows versions), XDebug may not work correctly if the path to the DLL file is in quotes. In this case, the line should be
zend_extension = C:\xampp\php\ext\php_xdebug-2.1.0-5.3-vc6.dll