Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

PEAR package install fails

i try to install packages from pear.phpqatools.org/phpqatools

First of all command pear config-get php_dir returns D:\Users\xampp\php\pear and I do not have rights to install on C drive.

Then according the instructions from http://phpqatools.org/ I enter :

pear config-set auto_discover 1
pear install pear.phpqatools.org/phpqatools

I have also tried to enter: pear install --alldeps pear.phpqatools.org/phpqatools

But result of all these attempts is a failure...

This is a log:

Package "pear.phpqatools.org/phpqatools" dependency "pear.phpunit.de/PHPUnit" has no releases
Unknown remote channel: pear.pdepend.org
Unknown remote channel: pear.phpmd.org
Unknown remote channel: components.ez.no
Package "pear.phpunit.de/PHPUnit_SkeletonGenerator" dependency "pear.phpunit.de/Text_Template" has
no releases
Package "pear.phpunit.de/phpcpd" dependency "pear.phpunit.de/File_Iterator" has no releases
Package "pear.phpunit.de/phpcpd" dependency "pear.phpunit.de/PHP_Timer" has no releases
Unknown remote channel: components.ez.no
Package "pear.phpunit.de/phploc" dependency "pear.phpunit.de/File_Iterator" has no releases
Unknown remote channel: components.ez.no
Package "pear.phpqatools.org/PHP_CodeBrowser" dependency "pear.phpunit.de/File_Iterator" has no rel
eases
Failed to download pear/Text_Highlighter within preferred state "stable", latest release is version
 0.7.3, stability "beta", use "channel://pear.php.net/Text_Highlighter-0.7.3" to install
Package "pear.phpqatools.org/PHP_CodeBrowser" dependency "pear.phpunit.de/PHPUnit" has no releases
Package "pear.phpqatools.org/PHP_CodeBrowser" dependency "pear.php.net/PhpDocumentor" has no releas
es
Package "pear.php.net/PHP_CodeSniffer" dependency "pear.phpunit.de/PHP_Timer" has no releases
Package "pear.phpunit.de/DbUnit" dependency "pear.phpunit.de/PHPUnit" has no releases
Package "pear.phpunit.de/DbUnit" dependency "pear.symfony-project.com/YAML" has no releases
WARNING: "pear/DB" is deprecated in favor of "pear/MDB2"
WARNING: "pear/Auth_SASL" is deprecated in favor of "pear/Auth_SASL2"
phpqatools/phpqatools requires package "channel://pear.pdepend.org/PHP_Depend"
phpqatools/phpqatools requires package "channel://pear.phpmd.org/PHP_PMD"
phpunit/PHPUnit_SkeletonGenerator requires package "channel://components.ez.no/ConsoleTools" (versi
on >= 1.6)
phpunit/phpcpd requires package "channel://components.ez.no/ConsoleTools" (version >= 1.6)
phpunit/phploc requires package "channel://components.ez.no/ConsoleTools" (version >= 1.6)
phpunit/phploc can optionally use PHP extension "bytekit"
phpqatools/PHP_CodeBrowser can optionally use package "pear/Text_Highlighter" (version >= 0.7.1)
downloading PHP_CodeBrowser-1.0.3.tgz ...
Starting to download PHP_CodeBrowser-1.0.3.tgz (172,253 bytes)
.....................................done: 172,253 bytes
downloading PHP_CodeSniffer-1.3.6.tgz ...
Starting to download PHP_CodeSniffer-1.3.6.tgz (352,931 bytes)
...done: 352,931 bytes
downloading DbUnit-1.1.2.tgz ...
Starting to download DbUnit-1.1.2.tgz (41,895 bytes)
...done: 41,895 bytes
downloading Console_CommandLine-1.1.3.tgz ...
Starting to download Console_CommandLine-1.1.3.tgz (38,507 bytes)
...done: 38,507 bytes
downloading Log-1.12.7.tgz ...
Starting to download Log-1.12.7.tgz (46,898 bytes)
...done: 46,898 bytes
downloading DB-1.7.14.tgz ...
Starting to download DB-1.7.14.tgz (133,103 bytes)
...done: 133,103 bytes
downloading MDB2-2.4.1.tgz ...
Starting to download MDB2-2.4.1.tgz (119,790 bytes)
...done: 119,790 bytes
downloading Mail-1.2.0.tgz ...
Starting to download Mail-1.2.0.tgz (23,214 bytes)
...done: 23,214 bytes
downloading Net_SMTP-1.6.1.tgz ...
Starting to download Net_SMTP-1.6.1.tgz (13,164 bytes)
...done: 13,164 bytes
ERROR: failed to mkdir C:\php\pear\tests\PHP_CodeSniffer\CodeSniffer\Core\File
ERROR: failed to mkdir C:\php\pear\docs\DbUnit\Samples\BankAccountDB\_files
ERROR: failed to mkdir C:\php\pear\data\Console_CommandLine\data
ERROR: failed to mkdir C:\php\pear\docs\Log\docs
ERROR: failed to mkdir C:\php\pear\docs\DB\doc
ERROR: failed to mkdir C:\php\pear\docs\MDB2\docs\examples
ERROR: failed to mkdir C:\php\pear\tests\Mail\tests
ERROR: failed to mkdir C:\php\pear\docs\Net_SMTP\docs
ERROR: failed to mkdir C:\php\pear\data\PHP_CodeBrowser\templates\css

I don't understand why install tries to mkdir on C:\php\pear\ and also how to solve problems with unknown remove channels...

like image 258
divide by zero Avatar asked Sep 07 '12 12:09

divide by zero


People also ask

What is PEAR in xampp?

In XAMPP, the PEAR framework is located in the /Applications/XAMPP/xamppfiles/bin directory and the current version ships with Mail – along with many other PEAR packages – already installed in the /Applications/XAMPP/xamppfiles/lib/php directory. To upgrade Mail and its dependencies, open Terminal and type: Code. Code.

What is a PHP PEAR package?

Overview. PHP PEAR packages are software components that developers write in the PHP language. The PHP PEAR Packages interface allows you to search for and add PEAR packages to your website, or view all of your website's available PHP packages.

What is PEAR and PECL?

pear is a php classes written in php Whereas pecl is extensions which not written in php and need compiling .


2 Answers

The only way I found to get pear working when using Xamp is do delete the folder and reinstall it from scratch. The pear client (for a long time the very very broken 1.9.2 version) doesn't work properly even when in the excepted location but there is no sane way to fix it when you install xamp somewhere else as the path is set in way to many files.

Follow the guide on http://pear.php.net/manual/en/installation.getting.php.

Download http://pear.php.net/go-pear.phar, execute it, select system wide install and adapt all the pathes to your location.

Once that is working and pear version reports 1.9.4 use

pear config-set auto_discover 1
pear install --force --alldeps pear.phpqatools.org/phpqatools

to "fix" anything the old installation left over.


Just using that version of pear should fix all your Package and channel troubles too.

It it, for some reason, doesn't use

pear channel-discover $everyChannelThatDoesNotWork
pear channel-update $thatChannel

for everything that gets reported as a problem.

like image 77
edorian Avatar answered Oct 14 '22 01:10

edorian


If, like it was for me, running all the pear config-set commands still result in this error:

failed to mkdir C:\php\pear\tests\PHP_CodeSniffer\CodeSniffer\Core\File

then there is a simple solution which took me a while to figure out:

Run your terminal as administrator

Really, thats the solution. Then like others said: goto c:\xampp\php in your terminal and type following commands:

pear config-set doc_dir C:\xampp\php\pear\docs
pear config-set cfg_dir C:\xampp\php\pear\cfg
pear config-set data_dir C:\xampp\php\pear\data
pear config-set man_dir C:\xampp\php\local\man
pear config-set test_dir C:\xampp\php\pear\tests
pear config-set www_dir C:\xampp\php\pear\www

pear install PHP_CodeSniffer
like image 31
Joery Avatar answered Oct 14 '22 02:10

Joery