1

当我尝试这个时: 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也没有说频道已经在注册表中,后面的步骤也成功了。

虽然我已经在上述步骤中解决了我的问题。虽然我未能使用这篇文章的评论和答案中所述的建议

但我只是好奇一开始可能出了什么问题。PEAR 为何无法获取正确版本的 Doctrine2?

即使接受 answer的过程也无济于事。

4

2 回答 2

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 应该会自动安装。

于 2013-01-23T21:28:50.677 回答
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也没有说频道已经在注册表中,后面的步骤也成功了。

谢谢大家!

于 2020-10-17T08:16:18.280 回答