問題描述
我還沒有完全弄清楚這一點.我找到的每篇文檔都涵蓋了如何使用 xdebug 調試在 Apache 中運行的腳本.我需要調試一個 php CLI 腳本.
那么,例如,我如何傳遞 XDEBUG_SESSION_START 變量以啟動 xdebug?
我特別想調試 CakePHP shell.因此,如果有人對此有任何其他見解,我將不勝感激.
謝謝.
在
(來源:
(來源:
(來源:
(來源:pascal-martin.fr)
希望這會有所幫助:-)
否則,您遇到什么具體問題?
I haven't quite figured this out. EVERY piece of documentation I've found covers how to use xdebug to debug scripts running in Apache. I need to debug a php CLI script.
So, for instance, how do I pass the XDEBUG_SESSION_START variable in to get xdebug to kick on?
I'm specifically trying to debug a CakePHP shell. So if anyone has any additional insight into that I'd be very appreciative.
Thanks.
There is a couple of notes about that in Xdebug's manual, like, for instance (quoting) :
export XDEBUG_CONFIG="idekey=session_name"
php myscript.php
If you are using Eclipse PDT to develop and debug your PHP scripts, there is not much difference between Apache or CLI : the configuration lloks quite the same, you just don't have to configure a web server, nor indicate an URL ; instead, you have to indicate the path to the PHP executable.
About the XDEBUG_SESSION_START
variable : well, you launch the whole script in "debug-mode", so you don't have any notion of "debugging-session", I'd say.
For instance, here's what Window > Preference > PHP > PHP executables
looks like for me right now, and, on the right, what I get when clicking on the Edit
button of the first one :
(source: pascal-martin.fr)
(source: pascal-martin.fr)
And the debug configurations
window :
(source: pascal-martin.fr)
And launching the debugging: it just works :
(source: pascal-martin.fr)
Hope this helps :-)
Else, what specific problem do you encounter ?
這篇關于如何使用 xdebug 調試 PHP CLI 腳本?的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網!