
And, to be honest, Josh's answer here somewhat helped me to understand the problem, but was not clear enough for me. I was setting up the breakpoints, but PhpStorm was not able to break the execution according to those points. So, after going through Jeffry's Be Awesome in PhpStorm, I had been stuck in a similar situation to the OP (in the chapter regarding Xdebug and Laravel). When this setting is set to 1, Xdebug will always attempt to start a remote debugging session and try to connect to a client, even if the GET/POST/COOKIE variable was not present. Normally you need to use a specific HTTP GET/POST variable to start remote debugging (see Remote Debugging). If you want your debug session to always start automatically (instead of initiating a remote debug via URL request parameter XDEBUG_SESSION_START=name, for example, when debugging CLI stuff), you can set XDEBUG to always start a remote debugging session with this additional configuration xdebug.remote_autostart = 1 The only caveat for this, is that as long as you have this configured, it will impact other things that you use php cli for. On my ubuntu box it's located at Loaded Configuration File: /etc/php/7.0/cli/php.iniĮdit the ini for your cli environment and use the same configuration you used to enable it for your web container I don't use phpstorm, but perhaps the solution that I use for debugging in netbeans will prove useful.Īrtisan serve uses a different ini file from the one loaded by your web container

Update: Good reminder from make sure "Start Listening for PHP Debug Connections" is enabled which you manually need to do if you don't run a PhpStorm configuration with "Debug" server.php just emulates Apache's mod_rewrite functionality. Actually the php artisan serve only purpose is to append the server.php to PHP Built-In Web Server. Now the PHPStorm will execute same command as php artisan serve does with additional interpreter options. Interpreter options: -dxdebug.remote_enable=1 -dxdebug.remote_mode=req -dxdebug.remote_port=9000 -dxdebug.remote_host=127.0.0.1.Check Use route script and select server.php in Laravel projects root directory.Document root: select Laravel's public catalog/directory.Workaround in PHPStorm is to create a Run configuration that calls PHP Built-in Web server directly. You can see the calling of built-in server here. Then these options given by -d are not passed to called PHP Built-in Web server.


if you execute from command line: $ php -dxdebug.remote_enable=1 -dxdebug.remote_mode=req -dxdebug.remote_port=9000 -dxdebug.remote_host=127.0.0.1 artisan serve artisan serve will call PHP Built-in Web Server but does not pass on the php command line options (named interpreter options in PHPStorm). Debugging using php artisan serve does not work unless you have enabled debugging in ini pointed out the reason.
