简体   繁体   English

FOSRest在symfony 2中给出致命错误

[英]FOSRest gives fatal error in symfony 2

i am trying to install FOSRest & FOSRestBundle 我正在尝试安装FOSRest和FOSRestBundle

initially , i have specified following settings in the deps 最初,我已经在指定的以下设置deps

[FOSRest]
    git=git://github.com/FriendsOfSymfony/FOSRest.git
    target=fos/FOS/Rest


[FOSRestBundle]
    git=git://github.com/FriendsOfSymfony/FOSRestBundle.git
    target=bundles/FOS/RestBundle

But that cause me into following error when i access http://localhost/Symfony/web/app_dev.php/ 但这导致我进入 http://localhost/Symfony/web/app_dev.php/时出现以下错误

Fatal error: Declaration of FOS\\RestBundle\\Routing\\Loader\\RestRouteLoader::setResolver() must be compatible with that of Symfony\\Component\\Config\\Loader\\LoaderInterface::setResolver() in /home/logicase/public_html/Symfony/vendor/bundles/FOS/RestBundle/Routing/Loader/RestRouteLoader.php on line 29 致命错误:FOS \\ RestBundle \\ Routing \\ Loader \\ RestRouteLoader :: setResolver()的声明必须与/ home / logicase / public_html / Symfony / vendor中的Symfony \\ Component \\ Config \\ Loader \\ LoaderInterface :: setResolver()的声明兼容/bundles/FOS/RestBundle/Routing/Loader/RestRouteLoader.php,第29行

After that i tried following setting to make to the master branch and above error remains the same 之后,我尝试按照以下设置对master branch进行设置,并且上述错误仍然相同

[FOSRest]
    git=git://github.com/FriendsOfSymfony/FOSRest.git
    target=fos/FOS/Rest
    version=origin/2.0

[FOSRestBundle]
    git=git://github.com/FriendsOfSymfony/FOSRestBundle.git
    target=bundles/FOS/RestBundle
    version=origin/2.0

and now when i run php ./bin/vendors install 现在当我运行php ./bin/vendors install

i get following message in console. 我在控制台中收到以下消息。

Installing/Updating FOSRest 5eb800bd63ba84e5fc7028386cb66373bc3efafc fatal: ambiguous argument 'origin/2.0': unknown revision or path not 安装/更新FOSRest 5eb800bd63ba84e5fc7028386cb66373bc3efafc致命:模棱两可的参数'origin / 2.0':未知修订或路径不正确

in the working tree. 在工作树上。 Use '--' to separate paths from revisions 使用“-”将路径与修订分开

Installing/Updating FOSRestBundle c11ab9d990a1e0e979b1c8ab72cc9793b4b2dcb5 fatal: ambiguous argument 'origin/2.0': unknown revision or path not in the working tree. 安装/更新FOSRestBundle c11ab9d990a1e0e979b1c8ab72cc9793b4b2dcb5致命:模棱两可的参数'origin / 2.0':未知修订或路径不在工作树中。

I tried following settings for FOSRest which solved my problem for symfony 2 我尝试了以下FOSRest设置,这解决了我的symfony 2问题

[FOSRest]
    git=git://github.com/FriendsOfSymfony/FOSRest.git
    target=fos/FOS/Rest
    version=origin/0.6

[FOSRestBundle]
    git=git://github.com/FriendsOfSymfony/FOSRestBundle.git
    target=bundles/FOS/RestBundle

As you can see, there is no 2.0 branch : https://github.com/FriendsOfSymfony/FOSRestBundle/branches https://github.com/FriendsOfSymfony/FOSRest/branches The installation documentation does not talk about it. 如您所见,这里没有2.0分支: https : //github.com/FriendsOfSymfony/FOSRestBundle/branches https://github.com/FriendsOfSymfony/FOSRest/branches安装文档没有讨论它。 You should just remove the version lines. 您应该只删除版本行。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM