Selenium – PHPUnit not recognizing cURL extension — can’t install selenium test

curlpearphpunitseleniumwamp

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

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

On this website, I was told to try this:

  1. If you are getting an error as “No valid packages found Install failed” then run the following command pear upgrade-all

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

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

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

run this command

php -me

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

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

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

cURL support    enabled
cURL Information    7.20.0

Best Answer

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

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


But there might be a case where one doesn't want to or can't enable the curl extension for some reason so I'll take that as an answer:

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 

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.