Skip to content

XDebug (PHP)

Quick guide

  • You will need an open workspace for this
  • Now, configure PHP to enable XDebug debugging. From CodeLite menu bar, click on the PHPRun XDebug Setup Wizard
  • At the end of the wizard, copy the text and paste it inside your php.ini file
  • Your php.ini should also have a section similar to this:
  • Next, change directory to the workspace folder (in my case it was: C:\Users\Eran\Documents\TestPHP and start PHP debug web server like this
cd C:\Users\Eran\Documents\TestPHP
C:\php74\php.exe -S -t .
  • Right click on your project folder and add new PHP file, name it test.php with the following content:

$test123 = "hello world";

$arr = [];
$arr[] = "Hello";
$arr[] = "World";

function baz($i) {
    echo $i."<br>";

function foo($i) {

for($i = 0; $i < 10; $i++){
  • Place a breakpoint at the for loop (keyboard shortcut F9)
  • Click on the Wait for debugger to connect button

wait to connect

  • Open a web browser and type in the address bar:
  • Clicking the ENTER button in the browser, the debug session starts

xdebug session

Back to top