XDebug:如何调试远程控制台应用程序? [英] XDebug: how to debug remote console application?
问题描述
我已经阅读了以下文档: http://xdebug.org/docs/remote
I have read this docs: http://xdebug.org/docs/remote
我可以调试我的Web应用程序.
但是调试器不会针对控制台命令启动.
I can debug my web application.
But the debugger doesn't launch for console command.
我的用于XDebug的.ini文件(有效):
My .ini file for XDebug (it works):
$ cat /etc/php5/fpm/conf.d/xdebug.ini
zend_extension=/usr/lib/php5/20090626/xdebug.so
xdebug.idekey="PHPSTORM"
xdebug.remote_connect_back=1
xdebug.remote_enable=1
.ini文件是相同的. .ini file for 我也尝试在调试之前添加 Also I tried to add 如何启用它? 简短答案: 我们需要设置2个环境变量,这些两条行: We need to set 2 environment variables, these two lines: 已更新:
优秀的IDE(例如PhpStorm)将为您做到这一点,只需将PHP解释器设置为远程解释器即可. Updated:
Good IDE (e.g. PhpStorm) will do it for you, just set PHP interpreter to remote one. 这篇关于XDebug:如何调试远程控制台应用程序?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!cli
is the same.export XDEBUG_CONFIG="idekey=PHPSTORM remote_enable=1 remote_connect_back=1"
,但这没有帮助.export XDEBUG_CONFIG="idekey=PHPSTORM remote_enable=1 remote_connect_back=1"
before debugging, but it didn't help.推荐答案
export PHP_IDE_CONFIG="serverName={SERVER NAME IN PHP STORM}"
export XDEBUG_CONFIG="remote_host=$(echo $SSH_CLIENT | awk '{print $1}') idekey=PHPSTORM"