PHPUnit does not recognize cURL extension - cannot install selenium test

I am on a Windows 7 machine with WAMPserver and I am trying to install the Selenium extension for PEAR. However, when I try to install it, they tell me that it requires an extension with the PHP extension "rotl":

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'm going to check the php.ini file to make sure it is included. Of course have:

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

On this site , I was told to try:

  • If you receive the error message "Invalid packages detected by Install failed", run the following command: pear upgrade-all

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

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

The php extension "curl" must be loaded into php as an extension.

run this command

php -me

If "curl" is not specified as one of the [PHP modules], it is not going to work.

And I'm not quite sure how to load this "in php as extension" on Windows. Is there an easy way to do this? Or make PEAR believe that I have it installed?

EDIT

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

 cURL support enabled cURL Information 7.20.0 
+3
source share
6 answers

In most cases, I would say that this is due to a php configuration problem.

The easiest way to check this is to use php -i and see if the curl extension appears on the output. If this is not the case, then something is wrong with the php command line. Most likely it is using the wrong php.ini . php --ini can be used to verify this


But there may be a case when for some reason you do not want or cannot enable the curl extension, so I will take this as an answer:

If you do not need selenium module for phpunit, there is a way to skip the installation of this package, since it is an optional dependency.

 pear install --onlyreqdeps phpunit/phpunit 

Do not install Selenium.

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

 pear install --force --alldeps phpunit/phpunit 

To say pear, to note that extension extension is not recognized, there are:

 pear install --force phpunit/PHPUnit_Selenium 

which can work if there is any problem due to which the pear does not select the extension, but ordinary scripts.

+12
source

I had this problem on Ubuntu and I solved it by running the following command:

sudo apt-get install php5-curl

Apparently there are two different curl packages (curl and php5-curl), php5-curl for php.

Hope this helps

+6
source

There are two php.ini files while working on WAMP

  • Under apache
  • Under php

Make sure that both files uncomment "extension=php_curl.dll" . Good after editing both files and restarting your Wamp server. The pear installer can look for curl settings in the PHP path, even if your Wamp server uses the Apache version.

+1
source

In different places, two php.ini should be modified, for example:

  • C: \ WAMP \ Bin \ PHP \ php5.3.8
  • C: \ WAMP \ Bin \ Apache \ Apache2.2.21 \ Bin

Starting at line 950 you will see

 ; Windows Extensions ; Note that ODBC support is built in, so no dll is needed for it. ; Note that many DLL files are located in the extensions/ (PHP 4) ext/ (PHP 5) ; extension folders as well as the separate PECL DLL download (PHP 5). ; Be sure to appropriately set the extension_dir directive. ; ;extension=php_bz2.dll ;extension=php_curl.dll ;extension=php_dba.dll ;extension=php_exif.dll ... 

Change "; extension = php_curl.dll" to "extension = php_curl.dll"

Reboot the server and you should be ready to go.

+1
source

when you change php.ini from the wamp server even from the php menu, it changes the version of apache, and the dose does not affect php at all. I changed them from the file system and it works. :-)

0
source

I followed this answer above and I changed these files and it works correctly.

 C:\wamp\bin\php\php5.3.13 C:\wamp\bin\apache\apache2.2.22\bin 
0
source

All Articles