Selenium – cannot install pear install phpunit/PHPUnit_Selenium

pearphpunitselenium

I am trying to install PHPUnit_Selenium using the command

pear install phpunit/PHPUnit_Selenium

The version of pear that i am running is 1.9.4. The above command returned

Attempting to discover channel "phpunit"…
Attempting fallback to https instead of http on channel "phpunit"…
unknown channel "phpunit" in "phpunit/PHPUnit_Selenium"
invalid package name/package file "phpunit/PHPUnit_Selenium"
install failed

Searching google I found this (a few times) as a suggestion. So I tried

pear channel-discover pear.phpunit.de

and

sudo pear channel-discover pear.phpunit.de (incase it made a difference)

previous command returned

Discovering channel pear.phpunit.de over http:// failed with message: channel-add: Cannot open "http://pear.phpunit.de/channel.xml" (File http://pear.phpunit.de:80/channel.xml not valid (received: HTTP/1.1 403 Forbidden ( Forefront TMG denied the specified Uniform Resource Locator (URL). )
))
Trying to discover channel pear.phpunit.de over https:// instead
Discovery of channel "pear.phpunit.de" failed (channel-add: Cannot open "https://pear.phpunit.de/channel.xml" (Connection to `pear.phpunit.de:443' failed: Operation timed out))

What do I need to do to install PHPUnit_Selenium?

Best Answer

The PEAR channel for phpunit has been discontinued as of the end of April 2014, to install PHPUnit and PHPUnit_Selenium install via composer.

Configure your composer.json to the specific package version (See PHPUnit_Selenium)

In your composer.json file, write: { "require": { "phpunit/phpunit": "*", "phpunit/phpunit-selenium": ">=1.3.3" } } Try the following command: $ composer install

Related Topic