PHPUnit not recognizing cURL extension -- can't install selenium test PHPUnit not recognizing cURL extension -- can't install selenium test selenium selenium

PHPUnit not recognizing cURL extension -- can't install selenium test


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.


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), the php5-curl one is for php.

Hope this could help


There needs to be changes made to two php.ini in different locations, for example:

  1. C:\wamp\bin\php\php5.3.8
  2. C:\wamp\bin\apache\Apache2.2.21\bin

Starting about 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 the ";extension=php_curl.dll" to "extension=php_curl.dll"

Restart your server and you should be ready to go.