PEAR包安装失败(PEAR package install fails)

2019-07-31 10:16发布

我尝试安装包from pear.phpqatools.org/phpqatools

首先命令pear config-get php_dir返回D:\Users\xampp\php\pear和我没有权限来安装在C车程。

然后根据从指令http://phpqatools.org/我输入:

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

我也试图进入: pear install --alldeps pear.phpqatools.org/phpqatools

但是,所有这些努力的结果是失败...

这是一个日志:

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

我不明白为什么安装尝试的mkdir在C:\php\pear\以及如何解决未知删除频道的问题...

Answer 1:

我发现使用XAMP时候才能梨工作的唯一方法是做删除的文件夹,并从头开始重新安装。 梨客户端(很长一段时间非常非常坏1.9.2版本)不正确的位置除外,即使工作,但没有解决它,当你的路径在路设置安装XAMP别的地方没有理智的办法许多文件。

按照上的导向http://pear.php.net/manual/en/installation.getting.php 。

下载http://pear.php.net/go-pear.phar ,执行它,选择system广泛的安装和所有pathes适应自己的位置。

一旦工作和pear version报告1.9.4使用

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

“修复”任何旧的安装遗留下来的。


只需使用该版本的梨应该可以解决你所有的包装和渠道的烦恼了。

它是,因为某些原因,不使用

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

对于被报告为问题的一切。



Answer 2:

如果像这对我来说,运行的所有梨的配置设置的命令仍然导致该错误:

未能MKDIR C:\ PHP \梨\测试\ PHP_CodeSniffer \ CodeSniffer \核心\文件

再有是我花了一段时间才能找出一个简单的解决方案:

运行你的终端以管理员身份

说真的,这就是解决方案。 然后,像其他人说:转到C:\ XAMPP \你的终端PHP和键入以下命令:

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


Answer 3:

请更正下列命令配置路径:

pear config-show

pear config-create / C:\xampp\php\pear.ini

pear -c c:\xampp\php\pear.ini config-set doc_dir c:\xampp\php\pear\docs
pear -c c:\xampp\php\pear.ini config-set bin_dir c:\xampp\php
pear -c c:\xampp\php\pear.ini config-set ext_dir c:\xampp\php\ext
pear -c c:\xampp\php\pear.ini config-set php_dir c:\xampp\php\pear
pear -c c:\xampp\php\pear.ini config-set cache_dir c:\xampp\php\cache
pear -c c:\xampp\php\pear.ini config-set cfg_dir c:\xampp\php\cfg
pear -c c:\xampp\php\pear.ini config-set data_dir c:\xampp\php\data
pear -c c:\xampp\php\pear.ini config-set download_dir c:\xampp\php\download
pear -c c:\xampp\php\pear.ini config-set php_bin c:\xampp\php\php.exe
pear -c c:\xampp\php\pear.ini config-set temp_dir c:\xampp\php\tmp
pear -c c:\xampp\php\pear.ini config-set test_dir c:\xampp\php\pear\tests
pear -c c:\xampp\php\pear.ini config-set www_dir c:\xampp\php\pear\www

pear -c c:\xampp\php\pear.ini config-show

每个梨命令应使用-cc:\xampp\php\pear.ini参数,例如:

pear -c c:\xampp\php\pear.ini config-set auto_discover 1
pear -c c:\xampp\php\pear.ini install pear.phpqatools.org/phpqatools


Answer 4:

无需手动删除PEAR缓存

pear clear-cache 

清除缓存梨不必再手动搜索缓存。

这解决了响应试图下载从中结构通道包时,我得到

 no release for package ....

它向我表示鸭梨有针对已经被记录为我的系统在那个特定的包装没有新的版本,但没有安装成功。

使用从稳定也改变优选状态 devel的

pear config-set preferred_state devel

所有我需要的软件包,其中大部分是要么devel的或阿尔法允许安装

希望这可以帮助别人从近一天浪费,这已经花了我越来越为什么我得到了“不发布”回复的底部。



Answer 5:

梨配置不正确。 我记得XAMPP的安装的梨不工作的开箱。

请参见这里了解如何正确设置必需的变量的指导。 查找被设置为默认值的,如C:\php\<something>并将其更改为文件夹XAMPP的梨/ PHP安装。



文章来源: PEAR package install fails