我试过这个:
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
结果如下:
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
并重新安装它。
现在,sudo pear channel-discover pear.doctrine-project.org
也没有说已经在注册表中的频道,后面的步骤也成功了。
虽然我已经在上述步骤中解决了我的问题。虽然我未能使用评论和答案中提出的建议post
但我只是好奇首先可能出现的问题。 PEAR如何无法获取Doctrine2的正确版本?
即使是accepted answer的过程也无济于事。
答案 0 :(得分:0)
您应该升级pear.symfony.com/Yaml
包。 PEAR列出了2.0.0版本的要求,但你只有1.0.6:
$ pear upgrade symfony/yaml
此外,它没有找到pear.symfony.com/console
的(兼容)版本 - 这是失败的主要原因。一个解决方案是pear clear-cache
电话,然后是pear channel-update pear.symfony.com
电话。之后,应自动安装控制台dep。
答案 1 :(得分:0)
我有与本主题所述相同的问题,但安装了Doctrine 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
我已经应用了@Paulo和@Parris在另一个SO QA中提出的建议。但这没有帮助。将其张贴在此处仅供记录。
编辑:
通过执行以下操作解决了上述问题:
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
,然后重新安装了它。
现在,sudo pear channel-discover pear.doctrine-project.org
也没有说频道已经在注册表中,以后的步骤也成功了。
谢谢!