I have a Laravel backend application and Vue.js 2 frontend application running on Laravel Valet, with SSL enabled. I’ve set up Xdebug with PHP 8.2, and everything works as expected.
When I test API endpoints directly from the browser or from postman, the breakpoints are hit in PhpStorm, confirming that my Xdebug and server configuration in PhpStorm is correct.
However, when the frontend makes API calls to the Laravel backend, the debugger doesn’t stop at breakpoints
Despite setting the frontend URL with port 443 and specifying the absolute backend path in PhpStorm, Xdebug redirects to the Valet path:
/home/ahmed/.config/composer/vendor/cpriego/valet-linux/server.php
The code execution stops at this line:
define('VALET_HOME_PATH', posix_getpwuid(fileowner(__FILE__))['dir'] . '/.valet');
When I try to resume the program, it doesn’t continue to the Laravel code breakpoints.
Also there is no Cookie is set in frontend browser with XDEBUG_SESSION=PHPSTORM
even the Xdebug extension is enabled
XDEBUG_SESSION=PHPSTORM" AFAIK this does not set the cookie. Better use Xdebug browser extension to enable/disable Xdebug cookie -- jetbrains.com/help/phpstorm/browser-debugging-extensions.htmlmydomain.comand API is onmydomain:3000) then the cookie should not stick. Double check this with your browser Network tab -- see what the request to such an endpoint has (cookies or GET/POST params).XDEBUG_SESSION=PHPSTORMas GET or POST parameter when the frontend makes API calls.