Can't install PHPUnit with PEAR 1.9.1 - phpunit

This appears to be an issue known with earlier versions of PEAR, unfortunately the solutions did not work for me.
My setup: Win7, 32bit. PHP directory: c:\Program Files\PHP.
All commands are run from a console with admin rights.
I have installed the latest (on 2012.02.17) version of PEAR available. Using the go-pear.phar it came as 1.9.1.
Then I tried to install PHPUnit by running pear install pear.phpunit.de/PHPUnit and got the following errors:
phpunit/PHPUnit requires PEAR Installer (version >= 1.9.4), installed version is
1.9.1
phpunit/PHPUnit requires package "channel://pear.symfony-project.com/YAML" (vers
ion >= 1.0.2)
phpunit/PHPUnit can optionally use package "phpunit/PHP_Invoker" (version >= 1.1
.0)
phpunit/File_Iterator requires PEAR Installer (version >= 1.9.2), installed vers
ion is 1.9.1
phpunit/Text_Template requires PEAR Installer (version >= 1.9.4), installed vers
ion is 1.9.1
phpunit/PHP_CodeCoverage requires PEAR Installer (version >= 1.9.4), installed v
ersion is 1.9.1
phpunit/PHP_CodeCoverage requires package "phpunit/File_Iterator" (version >= 1.
3.0)
phpunit/PHP_CodeCoverage requires package "phpunit/Text_Template" (version >= 1.
1.1)
phpunit/PHP_Timer requires PEAR Installer (version >= 1.9.2), installed version
is 1.9.1
phpunit/PHPUnit_MockObject requires PEAR Installer (version >= 1.9.4), installed
version is 1.9.1
phpunit/PHPUnit_MockObject requires package "phpunit/Text_Template" (version >=
1.1.1)
phpunit/PHP_TokenStream requires PEAR Installer (version >= 1.9.4), installed ve
rsion is 1.9.1
No valid packages found
install failed
I have tried upgrading PEAR to 1.9.4 by running pear upgrade pear, which results in message
pear/pear is already installed and is the same as the released version 1.9.4
upgrade failed
Forcing the upgrade with -f key works, packages with 1.9.4 in file names are downloaded and successfull install is reported, but pear -V still returns 1.9.1. PHPUnit install still fails. Please help, I am losing my mind.

Are you sure you are running the cmd/powershell with super user privileges? It has happened to me that if I don't the packages are successfully downloaded but not installed.

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.

Related

How to upgrade R version on a linux machine

I have a 3.4 R version on my machine and i want to install the 4 version , after downlowding the package and making it my R version still at 3.4 . what is the problem ? ( i have a ubuntu 16.04 working on my machine )
According to here, the installation requires to add
deb https://cloud.r-project.org/bin/linux/ubuntu xenial-cran40/
in the /etc/apt/sources.list
It is mentioned that
R 4.0 packages for Ubuntu on i386 and amd64 are available for most stable Desktop releases of Ubuntu until their official end of life date. However, only the latest Long Term Support (LTS) release is fully supported. As of April 27, 2020 the supported releases are Xenial Xerus (16.04; LTS), Bionic Beaver and Focal Fossa (20.04, amd64 only). Note, to install R 4.0 packages, a different sources.list entry is needed. See below for details.

how do I remove phpunit from pear correctly

So I have a problem, because at the moment I have phpunit in a 3.7 version installled through pear. Now, I wanted to upgrade this, but in the documentation they recommend installing it globally through composer. I've done this, it installs the current newest version(5.3) but if i type phpunuit -version it says that I have installed a version 3.7. Now, I can't somehow remove this package from pear, it says that phpunit can not be found, although I can see the phpunit files in the pear directory. If I do pear list, phpunit doesn't show up, so I'm not able to delete this package. Is there a way to overrite the pear phpunit package with that one, that I'm pulling in with composer?
pear list only lists packages from the default channel, which is pear.php.net unless you configured it otherwise.
To see all packages, use the -a flag as described in pear help list:
$ pear list -a
Installed packages, channel __uri:
==================================
(no packages installed)
Installed packages, channel doc.php.net:
========================================
Package Version State
pman 2015.06.19 stable
Installed packages, channel pear.geshi.org:
===========================================
Package Version State
geshi 1.0.8.10 stable
Installed packages, channel pear.php.net:
=========================================
Package Version State
Archive_Tar 1.4.0 stable
Console_CommandLine 1.2.0 stable
Console_Getopt 1.4.1 stable
Net_LDAP2 2.2.0 stable
PEAR 1.10.1 stable
PEAR_Manpages 1.10.0 stable
PHP_CodeSniffer 2.5.0 stable
Stream_Var 1.1.0 stable
Structures_Graph 1.1.1 stable
VersionControl_Git 0.4.4 alpha
XML_Util 1.3.0 stable
Installed packages, channel pecl.php.net:
=========================================
(no packages installed)

Attempting to run R with Atlas/OpenBLAS on redhat

For two days I've been trying to install Openblas/atlas with Lapack and use it in R. it's driving me crazy. I'm at a point where I can't even think anymore.
My server uses:
Red Hat Enterprise Linux Server release 6.6 (Santiago)
Here is what I've installed so far:
[root#tpdb05 atlas]# yum install atlas.x86_64 blas.x86_64 lapack.x86_64 Loaded plugins: product-id, refresh-packagekit, rhnplugin, security, subscription-manager
Setting up Install Process
Package atlas-3.8.4-2.el6.x86_64 already installed and latest version
Package blas-3.2.1-4.el6.x86_64 already installed and latest version
Package lapack-3.2.1-4.el6.x86_64 already installed and latest version
[root#tpdb05 ruser]#
yum install lapack.i686
Installed:
lapack.i686 0:3.2.1-4.el6
Dependency Installed:
blas.i686 0:3.2.1-4.el6 glibc.i686 0:2.12-1.166.el6_7.3 libgfortran.i686 0:4.4.7-16.el6
nss-softokn-freebl.i686 0:3.14.3-23.el6_7
Dependency Updated:
glibc.x86_64 0:2.12-1.166.el6_7.3 glibc-common.x86_64 0:2.12-1.166.el6_7.3 glibc-devel.x86_64 0:2.12-1.166.el6_7.3
glibc-headers.x86_64 0:2.12-1.166.el6_7.3 nss-softokn-freebl.x86_64 0:3.14.3-23.el6_7
yum install atlas.i686
Installed:
atlas.i686 0:3.8.4-2.el6
[root#tpdb05 SRPMS]# yum install rpm-build
Installed:
rpm-build.x86_64 0:4.8.0-47.el6
Dependency Installed:
redhat-rpm-config.noarch 0:9.0.3-44.el6
Dependency Updated:
rpm.x86_64 0:4.8.0-47.el6 rpm-libs.x86_64 0:4.8.0-47.el6 rpm-python.x86_64 0:4.8.0-47.el6
[root#tpdb05 SRPMS]# yum install atlas-c++-devel.x86_64
Installed:
atlas-c++-devel.x86_64 0:0.6.1-1.el5.rf
Dependency Installed:
atlas-c++.x86_64 0:0.6.1-1.el5.rf
several sources I've tried without success:
1 2 3
The R manual mentions the following:
The usual way to specify ATLAS will be via
--with-blas="-lf77blas -latlas"
However I have no clue where to use this command. While installing R? I'm pretty sure it should be possible to simply swap between libraries..
How do I get R to use the atlas/openblas/lapack libraries?

how to upgrade phpunit`s PHP_CodeCoverage

I have the problem of upgrading my phpunit with pyrus, and it always output something like:
Pyrus\Installer\Exception: Dependency validation failed for some packages to install, installation aborted
Pyrus\Dependency\Exception: pear.phpunit.de/PHPUnit requires package "channel://pear.phpunit.de/PHP_CodeCoverage" (version >= 1.2.1), installed version is 1.2.0
Pyrus\Dependency\Exception: pear.phpunit.de/PHPUnit can optionally use package "channel://pear.phpunit.de/PHP_Invoker" (version >= 1.1.0)
I have use the -f flag to force upgrade my phpunit from 3.7.0 to 3.7.1, but other packages still not upgrade.
I have tried to use the command php pyrus.phar upgrade phpunit/PHP_CodeCoverage to upgrade PHP_CodeCoverage, but I got the something like:
Skipping installed package pear.phpunit.de/PHP_CodeCoverage
How can I upgrade ohter package separatly?
Try --alldeps flag, should help: http://pear.php.net/manual/en/guide.users.commandline.installing.php

How do I install PHPUnit 3.5, instead of 3.6?

The current version of PHPUnit is 3.6, but until I update my code I need to use 3.5.15 instead. I'm having a lot of trouble trying to get 3.5.15 installed.
I start with a clean install of Zend Server, which only has a few basic PEAR packages installed. I channel-discover pear.phpunit.de and pear.symfony-project.com. Then I try installing 3.5.15 from a URL, but it fails:
# pear install http://pear.phpunit.de/get/PHPUnit-3.5.15.tgz
downloading PHPUnit-3.5.15.tgz ...
Duplicate package channel://pear.phpunit.de/PHPUnit-3.5.15 found
Duplicate package channel://pear.phpunit.de/PHPUnit-3.6.0 found
install failed
Next, I try installing from a downloaded file, but that also fails:
# pear install ~/Desktop/PHPUnit-3.5.15.tgz
Duplicate package channel://pear.phpunit.de/PHPUnit-3.5.15 found
Duplicate package channel://pear.phpunit.de/PHPUnit-3.6.0 found
install failed
And then from PEAR directly ... which installs 3.6 instead of what I asked for!
# pear install phpunit/PHPUnit-3.5.15
phpunit/PHPUnit can optionally use package "pear/XML_RPC2"
phpunit/PHPUnit can optionally use PHP extension "dbus"
phpunit/DbUnit requires package "phpunit/PHPUnit" (version >= 3.6.0), downloaded version is 3.5.15
phpunit/PHPUnit requires package "phpunit/DbUnit" (version >= 1.0.0)
phpunit/PHPUnit can optionally use package "phpunit/PHP_Invoker" (version >= 1.0.0)
downloading File_Iterator-1.3.0.tgz ...
downloading Text_Template-1.1.1.tgz ...
downloading PHP_CodeCoverage-1.1.0.tgz ...
downloading PHP_Timer-1.0.2.tgz ...
downloading PHPUnit_MockObject-1.1.0.tgz ...
downloading PHPUnit_Selenium-1.1.0.tgz ...
downloading YAML-1.0.6.tgz ...
downloading PHPUnit-3.6.0.tgz ...
downloading PHP_TokenStream-1.1.0.tgz ...
install ok: channel://pear.phpunit.de/File_Iterator-1.3.0
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.0
install ok: channel://pear.phpunit.de/PHP_CodeCoverage-1.1.0
install ok: channel://pear.phpunit.de/PHPUnit_MockObject-1.1.0
install ok: channel://pear.phpunit.de/PHPUnit-3.6.0
install ok: channel://pear.phpunit.de/PHPUnit_Selenium-1.1.0
Even using the -f option, to try to force an installation of the version I asked for, doesn't change anything.
How do I get 3.5.15 installed?
There are a lot of dependencies you have to deal with to have Pear NOT forcibly install PHPUnit 3.6. Here's what I did to get PHPUnit 3.5.15 installed: http://dustyreagan.com/downgrade-phpunit-3-6-to-3-5-15/
PHPUnit-3.5.15 requires DbUnit, but the latest version of DbUnit (1.1.0) requires PHPUnit-3.6. So that's why, when I installed PHPUnit 3.5.15, 3.6 would be installed instead. I worked around the problem by specifically installing DbUnit-1.0.3.
I'll accept my own answer, but it's not a complete answer - an attempt to install PHPUnit 3.5 results in the installation of a module which then forces the install of PHPUnit 3.6, and that doesn't seem right. This looks like a packaging problem, but I couldn't figure out where to report it.
I have not been able to install PHPUnit correctly on Ubuntu
Am installing on widnows 7 now
following advice from here
http://dustyreagan.com/downgrade-phpunit-3-6-to-3-5-15/
and abstracting it :) now hopeful that I will be able to install upon
ubuntu too
--
It worked now have phpunit correct version installed.
To get the question from the unanswered list:
PHPUnit-3.5.15 requires DbUnit, but the latest version of DbUnit (1.1.0) requires PHPUnit-3.6.
So that's why, when I installed PHPUnit 3.5.15, 3.6 would be installed instead. I worked around the problem by specifically installing DbUnit-1.0.3
This worked fine for me
http://dustyreagan.com/downgrade-phpunit-3-6-to-3-5-15/
install it via composer:
{
...
"repositories": [
{
"type": "pear",
"url": "pear.symfony-project.com"
},
{
"type": "pear",
"url": "pear.phpunit.de"
}
],
"require-dev": {
"pear-pear.phpunit.de/phpunit": "3.5.15",
"pear-pear.phpunit.de/PHP_CodeCoverage": "1.0.*",
"pear-pear.phpunit.de/File_Iterator": "1.2.3"
}
}

Resources