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
Related
I am on a Ubuntu 11.10 and trying to upgrade from 1.9.2 to 1.9.4, but it simply don't work. Here are the commands I am following in sequence
$ sudo apt-get install php-pear
Reading package lists... Done
Building dependency tree
Reading state information... Done
php-pear is already the newest version.
The following packages were automatically installed and are no longer required:
linux-headers-3.0.0-14-generic-pae libaccess-bridge-java-jni libaccess-bridge-java
Use 'apt-get autoremove' to remove them.
0 upgraded, 0 newly installed, 0 to remove and 6 not upgraded.
$ sudo pear channel-update pear.php.net
Updating channel "pear.php.net"
Channel "pear.php.net" is up to date
$ sudo pear upgrade-all
Nothing to upgrade-all
$ sudo pear install –alldeps pear.phpunit.de/PHPUnit
parsePackageName(): invalid package name "–alldeps" in "–alldeps"
invalid package name/package file "–alldeps"
Did not download optional dependencies: phpunit/PHP_Invoker, use --alldeps to download automatically
phpunit/PHPUnit requires PEAR Installer (version >= 1.9.4), installed version is 1.9.2
phpunit/PHPUnit can optionally use package "phpunit/PHP_Invoker" (version >= 1.1.0)
phpunit/Text_Template requires PEAR Installer (version >= 1.9.4), installed version is 1.9.2
phpunit/PHP_CodeCoverage requires PEAR Installer (version >= 1.9.4), installed version is 1.9.2
phpunit/PHP_CodeCoverage requires package "phpunit/Text_Template" (version >= 1.1.1)
phpunit/PHP_CodeCoverage can optionally use PHP extension "xdebug" (version >= 2.0.5)
phpunit/PHPUnit_MockObject requires PEAR Installer (version >= 1.9.4), installed version is 1.9.2
phpunit/PHPUnit_MockObject requires package "phpunit/Text_Template" (version >= 1.1.1)
phpunit/PHP_TokenStream requires PEAR Installer (version >= 1.9.4), installed version is 1.9.2
No valid packages found
install failed
Any thoughts?
There are two - required before the alldeps option! Try it with --alldeps and --force:
sudo pear install -–alldeps --force pear.phpunit.de/PHPUnit
I am using php 5.2.10 on redhat. Default installed pear package is PEAR 1.8.0. Now i want to install PHPunit via pear. So whenever i run command to install phpunit, it gives error :
pear install --alldeps phpunit/PHPUnit
phpunit/PHPUnit requires PEAR Installer (version >= 1.9.2), installed version is 1.8.0
phpunit/PHPUnit can optionally use PHP extension "dbus"
phpunit/DbUnit requires PEAR Installer (version >= 1.9.2), installed version is 1.8.0
phpunit/File_Iterator requires PEAR Installer (version >= 1.9.2), installed version is 1.8.0
phpunit/PHP_CodeCoverage requires PEAR Installer (version >= 1.9.1), installed version is 1.8.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.8.0
phpunit/PHPUnit_Selenium requires PEAR Installer (version >= 1.9.2), installed version is 1.8.0
phpunit/PHP_TokenStream requires PEAR Installer (version >= 1.9.1), installed version is 1.8.0
No valid packages found
install failed
I have tried command to upgrade pear:
pear upgrade pear
pear upgrade --force pear
but it returns :
Nothing to upgrade
Any solutions?
try this command :
pear upgrade --force http://pear.php.net/get/PEAR-1.9.4.tar
It will download the tar of pear 1.9.4 and upgrade the version.
If it is not working,check whether your php supports .zlib or not.
If it is not supported then configure your php with.zlib by this command:
./configure --with zlib
check this by phpinfo command on browser,it will support zlib in your php info page.
Run the above command to upgrade your pear version and check it by:
pear version
It will show your pear version as 1.9.4
then run command:
pear install --alldeps phpunit/PHPUnit
If you use RHEL 6, you have php-pear >= 1.9.4
You just have to update via yum, like yum install php-pear
But if you do this, it will maybe update your php installation too. You will have a list of all package to update and you have the choice to accept or cancel.
If pear tells you "nothing to upgrade", you should clear the cache:
$ pear clear-cache
$ pear upgrade pear
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.
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 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