-
-
Save carbontwelve/9089985 to your computer and use it in GitHub Desktop.
# Running xdebug in the console, for debugging Laravel artisan commands. Useful as I keep forgetting this one... | |
php -dxdebug.remote_autostart artisan | |
#Running phpcs for 5.3: | |
phpcs -pv --standards= --runtime-set testVersion 5.3 --ignore=*/public/*,*.js,*.css,*/tests/*,*/views/training/* . |
I use PhpStorm and simple add breakpoints there. Thanks for posting!
I haven't been able to get Xdebug working with Artisan console commands. https://stackoverflow.com/q/27936323/470749 looks like it might help.
For PHPStorm, simply setup running the command within PHPStorm.
Go to Menu item Run->Edit Configurations
Create a new PHP Script (hit the + symbol).
Give it a name.
For the File choose the artisan file.
Put the artisan comment in the "Arguments".
And Select the project root for the "Custom Working Directory"
No you can set breakpoints anywhere in the code and run it by going to the menu item: Run->Debug
What it is really doing is calling php with the following arguments.
php -dxdebug.remote_enable=1 -dxdebug.remote_mode=req -dxdebug.remote_port=9000 -dxdebug.remote_host=127.0.0.1 /Users/mikep/Projects/myproject/artisan report:codes
thank you @hfmikep
That did the trick @hfmikep
It seems that Arguments are actually the command you want to run (everything that comes after PHP artisan)
@hfmikep Thanks sharing this. Yeah @vladan-me, the Arguments are the artisan command that you want to run.
On my case I have some custom job that I need to debug, so for example, if the argument name is myjob:run (php artisan myjob:run) you just need to set myjob:run in the Arguments.
Thanks... Great when first google search results brings you the answer directly...
I want your babies
Thanks @hfmikep!
Do you know how can I set it for eclipse? After running the command, PHP debug is run in the Eclipse but does not come on Breakpoints!
I believe it's xdebug_break(); on the line you wish to break. Recommend using with xdebug chrome app.