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

后端 未结 8 1482
太阳男子
太阳男子 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:44

    I created a shell script to handle client debugging.

    script name: phpdebug

    #!/usr/bin/ksh
    php -dxdebug.remote_host=`echo $SSH_CLIENT | cut -d "=" -f 2 | awk '{print $1}'` $*
    

    I placed this script in /usr/bin and gave it execute permissions.

    The script takes the arguments passed into phpdebug and calls php with the xdebug arguments and appends the arguments passed into the shell script, the $* on the end.

提交回复
热议问题