How to trigger XDebug profiler for a command line PHP script?

后端 未结 8 1481
太阳男子
太阳男子 2020-12-04 04:48

XDebug offers the configuration directive \"xdebug.profiler_enable_trigger\" that allows to activate profiling by passing the GET or POST parameter \"XDEBUG_PROFILE\" when c

8条回答
  •  佛祖请我去吃肉
    2020-12-04 05:47

    In PhpStorm 7 using WAMP I got this to work by copying my already working xdebug settings from C:\wamp\bin\apache\apache2.2.22\bin\php.ini to the xdebug section of C:\wamp\bin\php\phpX.Y.Z\php.ini. Then I ran my script like so:

    php -d xdebug.idekey=PHPSTORM script.php
    

    This even worked for debugging laravel artisan scripts

    php -d xdebug.idekey=PHPSTORM artisan db:seed --force
    

提交回复
热议问题