Installing Doctrine2 with PEAR

六眼飞鱼酱① 提交于 2020-01-05 07:33:03

问题


While I tried this: sudo pear install -o pear.doctrine-project.org/DoctrineORM

I got the following error:

    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

Solved the above by doing the following: sudo apt-get purge php-pear

Ended up in results like:

    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

Same was for the following folders:

    /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

So I removed them all and then purged php-pear completely and reinstalled it again.

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

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.


回答1:


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

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.



来源:https://stackoverflow.com/questions/13797778/installing-doctrine2-with-pear

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!