Quantcast
Viewing all articles
Browse latest Browse all 6015

How to enable XDebug in VSCode with Ubuntu 22.04

I have followed multiple guides, but it seems none of them provide correct solution and most of them are outdated. XDebug is not working.

Environment: Ubuntu 22.04, PHP 8.1, Laravel 10.

I have working laravel installation, that I develop with:

php artisan serve

I've installed XDebug PHP extension:

sudo apt install php-xdebug

Configuration file seems to be at /etc/php/8.1/mods-available/xdebug.ini.

I have installed XDebug VSCode plugin and I have created launch.json with default content in VSCode.

{"version": "0.2.0","configurations": [    {"name": "Listen for Xdebug","type": "php","request": "launch","port": 9003    },  ]}

What changes I need to make changes to launch.json or xdebug.ini to enable XDebug "step debugging"?

Edit: Xdebug started working after I set xdebug.mode = debug and xdebug.start_with_request = yes in xdebug.ini.

After changes my /etc/php/8.1/mods-available/xdebug.ini content was:

zend_extension=xdebug.soxdebug.mode = debugxdebug.start_with_request = yes

Viewing all articles
Browse latest Browse all 6015

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>