Can't Install PHPunit via Pear, Requires Pear Installer >= 1.9.2, Can't Upgrade Pear from 1.9.0

Can't install PHPUnit via PEAR, requires PEAR Installer = 1.9.2, can't upgrade PEAR from 1.9.0

You basically have 2 pear installations on your machine, and the "pear upgrade" command updates the other one, not itself.

I assume that the pear version you're running has been installed via ubuntu's apt.

Find out where it has been installed with apt (on Debian/Ubuntu):

$ dpkg -L php-pear
...
/usr/share/php/PEAR.php
...
/usr/bin/pear

Now let's see where pear installs the files to:

$ pear config-get php_dir
/usr/share/php

On my machine, it is the same - but probably not on yours, which is the problem. Fix it by setting the php_dir, as well as the bin_dir:

$ pear config-set php_dir /usr/share/php
$ pear config-set bin_dir /usr/bin

Alternatively, remove the ubuntu pear and install it freshly from http://pear.php.net/go-pear.phar

Can't install PHPUnit with PEAR 1.9.1

An older version of PEAR was at c:\PHP, which was referenced in the PATH. PEAR saw this version first and ignored the newer one. The reference to the folder with the older version has to be removed from the PATH variable before installing PHPUnit.
I thank David Harkness for the clue.

Dreamhost - Latest version of PEAR

You have two versions of pear installed. The one you run, and the one you upgrade.

which pear will return a different path than pear list-files pear|grep script; that's your problem.

Either run the installed one (from list-files), or set the paths so that the which pear-version gets updated (pear config-show and pear config-set).

See Can't install PHPUnit via PEAR, requires PEAR Installer >= 1.9.2, can't upgrade PEAR from 1.9.0 for more info.

Windows Installing PHPUnit via PEAR - Installing PHPUnit via PEAR

I'm a really newbie but hope to be of any help.

I just succeeded installing PHPUnit a moment ago.

My env. is Wamp2.1.

I don't know exactly how this works but it worked for me, so try this.

pear clear-cache then,

pear install -a -f phpunit/PHPUnit

Somewhere in the failing message, I saw something about cache so I used clear-cache.

It did some trick in installing process, I guess.

Good luck!

How to install PHPUnit for CakePHP now that the PEAR method is no longer possible

Composer

Use either composer, which is supported for quite some time now and has the PHPUnit dependency already added in the included composer.json

  • http://book.cakephp.org/2.0/en/installation/advanced-installation.html
  • https://github.com/cakephp/cakephp/blob/2.6.0/composer.json

.phar

or the PHPUnit .phar variant, which is supported since recently, all you need to do is to put the phpunit.phar file in the vendors folder (both /vendors/ and /app/Vendor/ will work).

  • https://github.com/sebastianbergmann/phpunit/releases/tag/3.7.32
  • https://github.com/sebastianbergmann/phpunit/releases/download/3.7.32/phpunit.phar

Pear install via macports

I'm not to sure how that work on a mac but see if pear is using the right path you can check

pear config-show and use pear config-set to change them if needed

That should be the important ones:

PEAR executables directory     bin_dir          /opt/lampp/bin
PEAR documentation directory doc_dir /opt/lampp/lib/php/doc
PHP extension directory ext_dir /opt/lampp/lib/php/extensions/no-debug-non-zts-20060613
PEAR directory php_dir /opt/lampp/lib/php
PEAR Installer cache directory cache_dir /tmp/pear/cache
PEAR configuration file cfg_dir /opt/lampp/lib/php/cfg
directory
PEAR data directory data_dir /opt/lampp/lib/php/data
PEAR Installer download download_dir /tmp/pear/download
directory
PHP CLI/CGI binary php_bin /opt/lampp/bin/php

Maybe there is a better way to do that manually. I don't know any :)

Composer install error - requires ext_curl when it's actually enabled

This is caused because you don't have a library php5-curl installed in your system,

On Ubuntu its just simple run the line code below, in your case on Xamp take a look in Xamp documentation

sudo apt-get install php5-curl

For anyone who uses php7.0

sudo apt-get install php7.0-curl

For those who uses php7.1

sudo apt-get install php7.1-curl

For those who use php7.2

sudo apt-get install php7.2-curl

For those who use php7.3

sudo apt-get install php7.3-curl

For those who use php7.4

sudo apt-get install php7.4-curl

For those who use php8.0

sudo apt-get install php8.0-curl

Or simply run below command to install by your version:

sudo apt-get install php-curl


Related Topics



Leave a reply



Submit