Php 未定义函数xdebug\u code\u coverage\u started()
我试图在命令行上获得用于PHP的Xdebug代码覆盖率分析,但代码覆盖率函数出现未定义的函数错误。我没有使用PHPUnit,也没有使用IDE。我的文本编辑器是Komodo Edit 我正在使用:Php 未定义函数xdebug\u code\u coverage\u started(),php,command-line,wamp,xdebug,Php,Command Line,Wamp,Xdebug,我试图在命令行上获得用于PHP的Xdebug代码覆盖率分析,但代码覆盖率函数出现未定义的函数错误。我没有使用PHPUnit,也没有使用IDE。我的文本编辑器是Komodo Edit 我正在使用: 视窗8 PHP 5.4.12 Apache2.2.4(但命令行PHP) 黄蜂 我下载了Xdebug 2.2.4 for PHP5.4 VC9 TS(64位),并按照上的说明配置我的计算机 我更改了C:\wamp\bin\apache\Apache2.4.4\bin和C:\wamp\bin\php\p
- 视窗8
- PHP 5.4.12
- Apache2.2.4(但命令行PHP)
- 黄蜂
zend_extension = c:\wamp\bin\php\php5.4.12\ext\php_xdebug-2.2.4-5.4-vc9-x86_64.dll
[xdebug]
xdebug.remote_autostart=on
xdebug.remote_enable = on
xdebug.profiler_enable = off
xdebug.profiler_enable_trigger = off
xdebug.profiler_output_name = cachegrind.out.%t.%p
xdebug.profiler_output_dir = "c:/wamp/tmp/xdebug"
xdebug.idekey=xdebug
xdebug.remote_log="c:/wamp/tmp/xdebug/xdebug_remote.log"
xdebug.coverage_enable = on
我将XDEBUG_CONFIG=“idekey=XDEBUG”添加到我的环境变量中。然后我重新启动了WAMP
当我试图从脚本中调用xdebug\u code\u coverage\u start()时,我得到
PHP致命错误:调用未定义的函数xdebug\u code\u coverage\u started()
我尝试的任何代码覆盖率函数都会发生同样的情况。但是,var\u dump(xdebug\u get\u headers())
。我的phpinfo显示xdebug.coverage\u enable处于启用状态
我也尝试过:
- 未设置xdebug.coverage\u enable(默认为on)
- 未设置XDEBUG\u配置
- 将xdebug.remote\u enable设置为off
- 未设置xdebug.idekey、xdebug.remote\u log和xdebug.remote\u autostart
如何让PHP识别Xdebug代码覆盖函数?她的示例是适用于PHP 5.3或更高版本的Xdebug:
[Xdebug] zend_extension="<path to php_xdebug.dll>"
xdebug.remote_enable=1
xdebug.remote_port="<the port for Xdebug to listen to>"
(the default port is 9000)
xdebug.profiler_enable=1
xdebug.profiler_output_dir="<AMP home\tmp>"
[Xdebug]zend_extension=“”
xdebug.remote\u enable=1
xdebug.remote_port=“”
(默认端口为9000)
xdebug.profiler_enable=1
xdebug.profiler_output_dir=“”
试着使其尽可能接近,然后重新启动WAMP。这是否仍然相关?如果是这样的话,dll是否真的在php.ini中指向的文件夹中?@Peter是的,这就是dll所在的位置。您好,也许您必须为
c:\wamp\bin\php\php5.4.12\ext\php\uxdebug-2.2.4-5.4-vc9-x86\u64.dll添加引号,如“c:\wamp\bin\php\php5.4.12\ext\php\uxdebug-2.2.4-5.4-vc9-x86\u64.dll”
围绕.dll的引用可能是个问题。在Windows7上的XAMPP1.7.3中,在.dll周围加引号会导致问题。这可能就是问题所在。