用PEAR安装Doctrine2 [英] Installing Doctrine2 with PEAR
问题描述
虽然我尝试过:
sudo pear install -o pear.doctrine-project.org/DoctrineORM
我收到以下错误:
Package "pear.doctrine-project.org/DoctrineORM" dependency "pear.symfony.com/Console" has no releases
Package "pear.doctrine-project.org/DoctrineDBAL" dependency "pear.symfony.com/Console" has no releases
doctrine/DoctrineORM requires package "pear.symfony.com/Console" (version >= 2.0.0)
doctrine/DoctrineORM requires package "pear.symfony.com/Yaml" (version >= 2.0.0), installed version is 1.0.6
doctrine/DoctrineDBAL requires package "pear.symfony.com/Console" (version >= 2.0.0)
No valid packages found
install failed
通过执行以下操作解决上述问题:
sudo apt-get purge php-pear
Solved the above by doing the following:
sudo apt-get purge php-pear
结果如下:
Removing php-pear ...
Purging configuration files for php-pear ...
dpkg: warning: while removing php-pear, directory '/usr/share/doc/php5-common/PEAR' not empty so not removed
dpkg: warning: while removing php-pear, directory '/usr/share/php/.channels' not empty so not removed
与以下文件夹相同:
/usr/share/php/.registry/
/usr/share/php/.channels/.alias
/usr/share/php/data
/usr/share/doc/php5-common/PEAR/Archive_Tar/docs
/usr/share/doc/php5-common/PEAR
所以我删除它们,然后清除 php-pear
完全重新安装。
So I removed them all and then purged php-pear
completely and reinstalled it again.
现在, sudo pear channel-discover pear.doctrine-project .org
也没有说频道已经在注册表中,后面的步骤也成功了。
now, sudo pear channel-discover pear.doctrine-project.org
also didn't say channel already in registry and the later steps also succeeded.
虽然我已经解决了我在上述步骤中的问题。虽然我没有使用在这个帖子
Though I have solved my problem in the above steps. While I failed using the suggestions stated at comments and answers to this post
但我只是好奇首先可能出了问题。 PEAR如何无法获取适当版本的Doctrine2?
But I am just curious what could have been wrong in the first place. How PEAR wasn't being able to fetch proper versions of Doctrine2?
即使是接受答案的过程没有帮助。
Even the accepted answer's process didn't help.
推荐答案
您应该升级 pear.symfony.com/Yaml
包。 PEAR列出版本2.0.0作为要求,但您只有1.0.6:
You should have upgraded the pear.symfony.com/Yaml
package. PEAR listed version 2.0.0 as requirement, but you only had 1.0.6:
$ pear upgrade symfony/yaml
此外,它没有找到(兼容)版本的 pear.symfony.com/console
- 这是失败的主要原因。一个解决方案是一个 pear clear-cache
调用,然后是一个可能的 pear channel-update pear.symfony.com
打电话。之后,应自动安装控制台。
Also, it did not find (compatible) releases of pear.symfony.com/console
- this was the main reason for the failure. A solution would have been a pear clear-cache
call, followed by a possible pear channel-update pear.symfony.com
call. After that, the console dep should be installed automatically.
这篇关于用PEAR安装Doctrine2的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!