PHPUnit无法识别cURL扩展 - 无法安装selenium测试 [英] PHPUnit not recognizing cURL extension -- can't install selenium test

查看:209
本文介绍了PHPUnit无法识别cURL扩展 - 无法安装selenium测试的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在运行WAMPserver的Windows 7计算机上,我正在为PEAR安装Selenium扩展。但是,每当我尝试安装它,我被告知,它需要已经启用的PHP扩展curl:

I'm on a Windows 7 machine running a WAMPserver and I'm trying to install the Selenium extension for PEAR. However, whenever I try to install it, I'm told that it requires the already-enabled PHP extension "curl":

pear install phpunit / PHPUnit_Selenium

Package "pear.phpunit.de/PHPUnit_Selenium" dependency "pear.phpunit.de/PHPUnit" has no releases
phpunit/PHPUnit_Selenium requires PHP extension "curl"
No valid packages found
install failed

所以我去检查我的php.ini文件,看看是否启用。果然,它是:

So I go to check my php.ini file to see if it's enabled. Sure enough, there it is:

extension=php_apc.dll
;extension=php_bz2.dll
extension=php_curl.dll
;extension=php_dba.dll
;extension=php_exif.dll


$ b b

此网站 ,我被告知尝试这样:

On this website, I was told to try this:



  1. 如果您收到错误没有有效的包找到安装失败,然后运行以下命令pear upgrade-all


但是当我运行那个命令只是告诉我没有升级所有

But when I run that command, it just tells me Nothing to upgrade-all.

搜索我的具体错误后, =https://bugs.php.net/bug.php?id=59028 =nofollow>提及的PHP错误

After searching for my specific error, I found a PHP bug that mentions


curlphp扩展需要作为
扩展加载到php本身。

The "curl" php extension needs to be loaded into php itself as an extension.

运行此命令

php -me

如果curl没有作为[PHP Modules]之一列出, $ b工作。

If "curl" is not listed as one of the [PHP Modules] it is not going to work.

我不完全确定如何在Windows上将此加载到php本身作为扩展。有没有一个简单的方法来做到这一点?

And I'm not entirely sure how to load this "into php itself as an extension" on Windows. Is there an easy way to do this? Or to get PEAR to believe that I do have this installed?

EDIT

对于记录,PHP(从php_info())注意到我的curl扩展

For the record, my curl extension is noticed by PHP (from php_info()):

cURL support    enabled
cURL Information    7.20.0


推荐答案

在大多数情况下,我会说这是来自一个php配置问题。

In most cases I'd say that this comes from a php configuration issue.

最简单的检查方法是使用 php -i ,看看curl扩展是否显示在输出中。如果它没有出现错误的命令行php。有可能是使用错误的 php.ini 文件。 php --ini 可用于检查此

The easiest way to check for this is to use php -i and see if the curl extension shows up in the output. If it doesn't there is something wrong with the command line php. Chances are it's using the wrong php.ini file. php --ini can be used to check this

如果不要需要 phpunit的selenium模块有一种方法跳过这个包的安装,因为它是一个可选的依赖。

If you don't need the selenium module for phpunit there is a way of skipping the install of this package as it is an optional dependency.

pear install --onlyreqdeps phpunit/phpunit 

不应安装Selenium。

should not install Selenium.

并且只是为了总是有一件事要尝试:

And just in case there is always one thing to try:

pear install --force --alldeps phpunit/phpunit






要告诉梨注意关于卷曲延伸未被识别的注意事项:




To tell pear to note care about the curl extension not being recognised there is:

pear install --force phpunit/PHPUnit_Selenium

这可能会工作,如果有一些问题,扩展,但正常的脚本是。

which might work if there is some issue that just pear is not picking the extension up but normal scripts are.

这篇关于PHPUnit无法识别cURL扩展 - 无法安装selenium测试的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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