使用xdebug和netbeans调试php-cli脚本? [英] Debugging php-cli scripts with xdebug and netbeans?

查看:247
本文介绍了使用xdebug和netbeans调试php-cli脚本?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经设法从IDE本身启动php-cli脚本调试会话,但我需要从shell /命令行启动调试会话。这些是相当复杂的维护PHP脚本,需要大量的输入参数,所以从Netbeans中输入参数是有点麻烦。

I have managed to initiate php-cli script debug session from the IDE itself, but I need to start the debugging session from the shell / command line. These are rather complex maintenance PHP scripts which take a lot of input parameters, so entering arguments from within Netbeans is a bit cumbersome.

我之前做过Zend studio < a href =http://kb.zend.com/index.php?View=entry&EntryID=130 =nofollow noreferrer> http://kb.zend.com/index.php?View=entry& ; EntryID = 130 ,但现在我需要让它与Netbeans一起工作。

I have done it before with Zend studio http://kb.zend.com/index.php?View=entry&EntryID=130 but now I need to get it working with Netbeans.

提前感谢。

推荐答案

我通过以下方式在Ubuntu / Netbeans上工作:

I got this working on Ubuntu/Netbeans by:


  • 复制xdebug config行从/etc/php5/apache2/php.ini文件导入/etc/php5/cli/php.ini

  • 使用调试会话的名称设置环境变量(您可以获取因此命令是: export XDEBUG_CONFIG =idekey = netbeans-xdebug
  • 这是从网页的url中的查询字符串netbeans启动时开始调试)
  • copying the xdebug config lines from the /etc/php5/apache2/php.ini file into /etc/php5/cli/php.ini
  • setting an environment variable with the name of the debug session (you can get this from the query string in the url of the page netbeans launches when you start debugging) so the command is: export XDEBUG_CONFIG="idekey=netbeans-xdebug"

然后,它只是一个开始在netbeans调试和在 php myscript.php 命令行。

Then it's simply a case of starting debugging in netbeans and doing php myscript.php at the command line.

注意:
如果要使用netbeans进行远程调试,您需要对从命令行运行的文件使用Debug File,不正常调试。

Note: If you want to debug remotely using netbeans you need to use Debug File on the file that is being run from the command line, not normal Debug.

这篇关于使用xdebug和netbeans调试php-cli脚本?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆