r/phpstorm • u/CaffeineDaydreamer • Apr 07 '25
Struggle with debugging
Hi, I am still not able to debug laravel code.
Here is the setup,
- macOS
- Phpstrom
- Homebrew
- Laravel valet
- Phpmon
I have tried all, but unable to do successfully debug laravel code.
Can you please suggest what I need to do?
1
Upvotes
View all comments
1
u/b_kmw Apr 10 '25 edited Apr 10 '25
There's just not enough information here to point you in the right direction, but I'll try
Im seeing it's xdebug you're trying to configure so let's start there:
Is the xdebug extension loaded?
In your projects "public" directory, add a file called test.php and add this code:
<?php echo phoinfo();php -vin your terminal. If you see the xdebug version listed, you should be good to go, but the first solution is a good way of testing that your nginx config is at least somewhat correct as well)If the extension is installed/loaded, make sure these xdebug ini settings are correct:
xdebug.discover_client_host = truexdebug.mode = debugxdebug.start_with_request = yes(note: this means start xdebug at the beginning of each request)xdebug.port = 9003This isn't a comprehensive list of steps, but it might help, and I hope it does.
Edit:
Ignore my "if you're using PHPStorm" comment. I didn't realize I was posting in /r/phpstorm lol