Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

alnouirah's avatar

Xdebug with vsc and laravel

Hello guys , :) i want to use xdebug with vsc for debugging my code , the problem is when it comes to normal php scripts it works fine but when it comes to laravel projects it doesn't work !! did i miss anything ?

0 likes
7 replies
tykus's avatar

when it comes to normal php scripts

Are these scripts running from CLI? Webserver (PHP-FPM) and CLI are two different configurations.

1 like
alnouirah's avatar

tbh , i don't know exactly where they run ! all what i have done is to follow up with some articles to do it . i only set the breakpoints and start the project form browser .

tykus's avatar
tykus
Best Answer
Level 104

If you put phpinfo() at the top of the public/index.php file, you can see which PHP version your webserver is using, along with the extensions that were loaded. If you cannot see xdebug amongst the extensions loaded, then you need to find the config file (search php.ini) being used by PHP, and add the extension there. Remember to restart the PHP-FPM process when you make changes.

1 like
alnouirah's avatar

it seems that i miss a lot of information . just to make it clear i am using laravel with WAMP for windows OS. and i have setup the php.ini file that inside c\wamp\bin\php\php.ini. I found xdebug extention in projects run from wamp/www folder but when it comes to laravel project it's not ! exactly as you said . so , where i can found the right php.ini !

alnouirah's avatar

so , to find the php.ini used by php you just type php --ini . it show me the file i already edit it and added the xdebug extension to it ! so why the extension is work for normal php prjects but not for laravel !

tykus's avatar

to find the php.ini used by php you just type php --ini

That's the CLI. I specifically mentioned phpinfo() so you are seeing the PHP version being used by the web server.

alnouirah's avatar

oh sorry , after five minutes of debugging the steps i have done :D , it turns out i edited the php.ini inside apache which symed link to another on . after i add the extension to the right file it worked correctly . thanks for your help :) .

Please or to participate in this conversation.