I have installed with success phpunit:
sudo pear install --alldeps pear.phpunit.de/PHPUnit
but when I prompt phpunit in console I am getting error:
bash: /usr/bin/phpunit: No file or directory
I have:
PEAR Version: 1.9.4
PHP Version: 5.3.6-13ubuntu3.6
Could somebody give me any advice?
pear list gives me:
Installed packages, channel __uri:
==================================
(no packages installed)
Installed packages, channel components.ez.no:
=============================================
Package Version State
Base 1.8 stable
ConsoleTools 1.6.1 stable
Installed packages, channel doc.php.net:
========================================
(no packages installed)
Installed packages, channel pear.php.net:
=========================================
Package Version State
Archive_Tar 1.3.9 stable
Console_Getopt 1.3.1 stable
PEAR 1.9.4 stable
Structures_Graph 1.0.4 stable
XML_Util 1.2.1 stable
Installed packages, channel pear.phpunit.de:
============================================
Package Version State
File_Iterator 1.3.1 stable
PHPUnit 3.6.10 stable
PHPUnit_MockObject 1.1.1 stable
PHP_CodeCoverage 1.1.2 stable
PHP_Invoker 1.1.0 stable
PHP_Timer 1.0.2 stable
PHP_TokenStream 1.1.3 stable
Text_Template 1.1.1 stable
Installed packages, channel pear.symfony-project.com:
=====================================================
Package Version State
YAML 1.0.6 stable
Installed packages, channel pecl.php.net:
=========================================
(no packages installed)
Use the --force
sudo pear install --force --alldeps pear.phpunit.de/PHPUnit
This will reinstall all the packages and usually works around the most common pear issues and this looks like one of the cases where it just didn't quite finish up everything and if you don't --force it to reinstall it will assume all packages are working fine.
Related
I've installed PHP 5.6 on my El Capitan OSX with brew install php56 --with-pear. This installs PHP in /usr/local/Cellar/php56/5.6.18
with a symlink from /usr/local/opt/php56 to there. Seems to work fine.
OK, I need to install the Cache_Lite package, so I do pear install Cache_Lite. PEAR goes through its installation steps without complaint:
downloading Cache_Lite-1.7.16.tgz ...
Starting to download Cache_Lite-1.7.16.tgz (33,236 bytes)
.........done: 33,236 bytes
install ok: channel://pear.php.net/Cache_Lite-1.7.16
But when I do pear list Cache_Lite is nowhere to be seen:
Installed packages, channel pear.php.net:
=========================================
Package Version State
Archive_Tar 1.4.0 stable
Console_Getopt 1.4.1 stable
PEAR 1.10.1 stable
Structures_Graph 1.1.1 stable
XML_Util 1.3.0 stable
When I check the php56 folder in Finder, I see there is a Cache folder there with the Cache_Lite files. And when I add the folder to my PHP pages with ini_set("include_path", '/usr/local/opt/php56/lib/php:' . ini_get("include_path") ); my PHP page in the browser stops complaining it can't find Cache_Lite.
PEAR, Why don't you list Cache_Lite when you've installed Cache_Lite? Am I misunderstanding pear list?
I read the other PHPUnit installation questions but haven't had any success. What is going on with my PEAR install?
$ sudo pear update-channels
Updating channel "components.ez.no"
Channel "components.ez.no" is up to date
Updating channel "doc.php.net"
Channel "doc.php.net" is up to date
Updating channel "pear.php.net"
Channel "pear.php.net" is up to date
Updating channel "pear.phpunit.de"
Channel "pear.phpunit.de" is up to date
Updating channel "pear.symfony-project.com"
Channel "pear.symfony-project.com" is up to date
Updating channel "pecl.php.net"
Channel "pecl.php.net" is up to date
$ sudo pear upgrade pear
Nothing to upgrade
$ sudo pear install phpunit/PHPUnit
phpunit/PHPUnit requires PEAR Installer (version >= 1.9.2), installed version is 1.9.0
phpunit/PHPUnit can optionally use PHP extension "dbus"
phpunit/DbUnit requires PEAR Installer (version >= 1.9.2), installed version is 1.9.0
phpunit/File_Iterator requires PEAR Installer (version >= 1.9.2), installed version is 1.9.0
phpunit/PHP_CodeCoverage requires PEAR Installer (version >= 1.9.1), installed version is 1.9.0
phpunit/PHP_CodeCoverage requires package "phpunit/File_Iterator" (version >= 1.2.2)
phpunit/PHP_CodeCoverage can optionally use PHP extension "xdebug" (version >= 2.0.5)
phpunit/PHPUnit_MockObject requires PEAR Installer (version >= 1.9.2), installed version is 1.9.0
phpunit/PHPUnit_Selenium requires PEAR Installer (version >= 1.9.2), installed version is 1.9.0
phpunit/PHP_TokenStream requires PEAR Installer (version >= 1.9.1), installed version is 1.9.0
No valid packages found
install failed
$ pear list
Installed packages, channel pear.php.net:
=========================================
Package Version State
Archive_Tar 1.3.7 stable
Cache_Lite 1.7.11 stable
Console_Getopt 1.3.1 stable
HTTP_Request2 2.0.0RC1 beta
Net_URL2 0.3.1 beta
PEAR 1.9.3 stable
Structures_Graph 1.0.4 stable
XML_RPC2 1.1.1 stable
XML_Util 1.2.1 stable
greg#ubuntu:~$ pear -V
PEAR Version: 1.9.0
PHP Version: 5.3.6
Zend Engine Version: 2.3.0
Running on: Linux ubuntu 2.6.32-32-generic-pae #62-Ubuntu SMP Wed Apr 20 22:10:33 UTC 2011 i686
pear list reports 1.9.3 installed, pear -V reports 1.9.0!?!
Update Tried KingCrunch suggestion.
$ sudo pear install -f pear
[sudo] password for greg:
downloading PEAR-1.9.3.tgz ...
Starting to download PEAR-1.9.3.tgz (295,774 bytes)
...........................done: 295,774 bytes
install ok: channel://pear.php.net/PEAR-1.9.3
PEAR: Optional feature webinstaller available (PEAR's web-based installer)
PEAR: Optional feature gtkinstaller available (PEAR's PHP-GTK-based installer)
PEAR: Optional feature gtk2installer available (PEAR's PHP-GTK2-based installer)
PEAR: To install optional features use "pear install pear/PEAR#featurename"
$ pear -V
PEAR Version: 1.9.0
PHP Version: 5.3.6
Zend Engine Version: 2.3.0
Running on: Linux ubuntu 2.6.32-32-generic-pae #62-Ubuntu SMP Wed Apr 20 22:10:33 UTC 2011 i686
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
If you are not successful with the pear part have a look at this.
wget https://phar.phpunit.de/phpunit.phar
chmod +x phpunit.phar
mv phpunit.phar /usr/local/bin/phpunit
ref: http://phpunit.de/manual/3.7/en/installation.html
You can also immediately use the PHAR after you have downloaded it;
wget https://phar.phpunit.de/phpunit.phar
php phpunit.phar
I'm attempting to install the Propel ORM on CentOS which has a dependency for phing. I've run the following which was succesful:
pear channel-discover pear.phing.info
pear install phing/phing
pear install Log
However when I run ./propel-gen as is described on the Propel documentation it fails with the error:
./propel-gen: line 69: phing: command not found
However if I check to see if phing is installed it doesn't appear in the package list, yet if I try to install it again it fails:
$ pear list
Installed packages, channel pear.php.net:
=========================================
Package Version State
Archive_Tar 1.3.8 stable
Console_Getopt 1.3.1 stable
Log 1.12.7 stable
PEAR 1.9.4 stable
Structures_Graph 1.0.4 stable
XML_Util 1.2.1 stable
$ pear install phing/phing
phing/phing is already installed and is the same as the released version 2.4.7.1 install failed
I need to be able to run ./propel-gen to test that Propel has been installed successfully, so I'm a little stuck at this point. I've also double checked that Pear is in the PHP include_path by running the following which exits bool(true):
<?php
require_once 'System.php';
var_dump(class_exists('System', false));
?>
Any help in debugging & fixing this is greatly appreciated! :)
You need to have pear's bin (executable) directory in your $PATH variable.
Find the path with
$ pear config-get bin_dir
Add this to your path that way:
$ export PATH=$PATH:/usr/share/php/bin
When running my Pear phpunit/PHPUnit install - this is the error I get
Starting to download YAML-1.0.6.tgz (10,010 bytes)
.....done: 10,010 bytes
package.xml version "2.1" is not supported, only 1.0 and 2.0 are supported.
Download of "symfony/YAML" succeeded, but it is not a valid package archive
Has anyone seen this before?
You most likely have an old version of Pear.
Try running the following
pear upgrade PEAR
I was getting the same issue and ended up reinstalling symfony/YAML and it worked, my error was:
phpunit/PHPUnit requires package "symfony/YAML" (version >= 1.0.2, version <= 1.0.2), installed version is 1.0.6
So I uninstalled:
sudo pear uninstall symfony/YAML
From that I reinstalled the version it wanted
sudo pear install symfony/YAML-1.0.2
And re-ran the install:
sudo pear install phpunit/PHPUnit
"install ok: channel://pear.phpunit.de/PHPUnit-3.6.12"
Same issue on CentOS 5.8 after following http://www.phpunit.de/manual/3.6/en/installation.html, I resolved it with
pear upgrade --force PEAR
pear list
which resulted in
Installed packages, channel pear.php.net:
=========================================
Package Version State
Archive_Tar 1.3.10 stable
Console_Getopt 1.3.1 stable
PEAR 1.9.4 stable
Structures_Graph 1.0.4 stable
XML_RPC 1.5.5 stable
XML_Util 1.2.1 stable
allowing me to successfully run
pear install pear.phpunit.de/PHPUnit
resulting in
install ok: channel://pear.phpunit.de/File_Iterator-1.3.1
install ok: channel://pear.phpunit.de/Text_Template-1.1.1
install ok: channel://pear.phpunit.de/PHP_Timer-1.0.2
install ok: channel://pear.symfony-project.com/YAML-1.0.6
install ok: channel://pear.phpunit.de/PHP_TokenStream-1.1.3
install ok: channel://pear.phpunit.de/PHP_CodeCoverage-1.1.3
install ok: channel://pear.phpunit.de/PHPUnit_MockObject-1.1.1
install ok: channel://pear.phpunit.de/PHPUnit-3.6.12
I'm trying to install PHPUnit. I'm getting an error message that I need to update the version of Pear, but then when I try to do it, it says Nothing to update.
Any ideas what's happening here?
UPDATE - this is the output on `pear list`
=========================================
Package Version State
Archive_Tar 1.3.7 stable
Auth 1.6.4 stable
Auth_RADIUS 1.0.7 stable
Auth_SASL 1.0.4 stable
Benchmark 1.2.8 stable
Cache_Lite 1.7.9 stable
Console_CommandLine 1.1.3 stable
Console_Getopt 1.3.1 stable
Crypt_CHAP 1.5.0 stable
DB 1.7.13 stable
File_Passwd 1.1.7 stable
File_SMBPasswd 1.0.3 stable
HTML_Common 1.2.5 stable
HTML_QuickForm 3.2.12 stable
HTTP_Client 1.2.1 stable
HTTP_Request 1.4.4 stable
Log 1.12.6 stable
MDB 1.3.0 stable
MDB2 2.4.1 stable
Mail 1.2.0 stable
Mail_Mime 1.8.1 stable
Net_DIME 1.0.2 stable
Net_POP3 1.3.8 stable
Net_SMTP 1.5.2 stable
Net_Socket 1.0.10 stable
Net_URL 1.0.15 stable
Net_Vpopmaild 0.3.2 beta
PEAR 1.9.2 stable
Payment_DTA 1.4.1 stable
SOAP 0.12.0 beta
Structures_Graph 1.0.4 stable
XML_Parser 1.3.4 stable
XML_RPC2 1.0.8 stable
XML_Util 1.2.1 stable
I had the same problem and in my case it was because phpunit has a dependency of the pear.symfony.com channel. The following worked for me:
pear uninstall phpunit
pear channel-discover pear.phpunit.de
pear channel-discover pear.symfony.com
pear install phpunit/phpunit
Without the symfony channel, pear did only install in version 3.5.15. After adding the channel, i got 3.7.7.
First, clear the cache. Stale package information may be in there.
$ pear clear-cache
$ pear upgrade pear
Then, verify you get the correct remote package information - it should show 1.9.2:
$ pear remote-info pear
Latest 1.9.2
Installed 1.9.1
...
If the latest is not 1.9.2, you've got strange network problems. If the "installed" is listed as 1.9.2., your installation is strange :)
Verify that the PEAR version you are using is the same you are trying to upgrade:
$ which pear
/usr/bin/pear
$ pear list pear|grep bin
script /usr/bin/pear
script /usr/bin/peardev
script /usr/bin/pecl
If they do not match, fix your include path to include the correct pear version, or the pear configuration by using
$ pear config-show
$ pear config-get bin_dir
$ pear config-set bin_dir /path/to/my/bin
and force-upgrade to install the files to the correct locations:
$ pear upgrade -f pear