当我在我的symfony项目中安装sonata-admin软件包时。我已将yml文件配置如下:
sonata_block:
default_contexts: [cms]
blocks:
sonata.admin.block.admin_list:
contexts: [admin]
sonata.block.service.text:
sonata.block.service.action:
sonata.block.service.rss:
我的deps文件如下:
[SonataAdminBundle]
git=git://github.com/sonata-project/SonataAdminBundle.git
target=/bundles/Sonata/AdminBundle
version=origin/2.0
我收到以下错误
安装/更新SonataAdminBundle a25d8c0e084ed4a175b89a93e93bdea2cf5563ab 致命:无法查找github.com(端口9418)(没有这样的主机已知。)
[Symfony\Component\Config\Exception\FileLoaderLoadException]
Cannot import resource "C:\wamp\www\Symfony\app/config\config.yml" from "C:\wa
mp\www\Symfony\app/config/config_dev.yml".
[InvalidArgumentException]
There is no extension able to load the configuration for "sonata_block" (in C:
\wamp\www\Symfony\app/config\config.yml). Looked for namespace "sonata_block", f
ound "framework", "security", "twig", "monolog", "swiftmailer", "doctrine", "ass
etic", "sensio_framework_extra", "jms_security_extra", "acme_hello", "acme_task"
, "ensl_jobeet", "acme_demo", "web_profiler", "sensio_distribution"
[Symfony\Component\Config\Exception\FileLoaderLoadException]
Cannot import resource "C:\wamp\www\Symfony\app/config\config.yml" from "C:\wa
mp\www\Symfony\app/config/config_dev.yml".
[InvalidArgumentException]
There is no extension able to load the configuration for "sonata_block" (in C:
\wamp\www\Symfony\app/config\config.yml). Looked for namespace "sonata_block", f
ound "framework", "security", "twig", "monolog", "swiftmailer", "doctrine", "ass
etic", "sensio_framework_extra", "jms_security_extra", "acme_hello", "acme_task"
, "ensl_jobeet", "acme_demo", "web_profiler", "sensio_distribution"
在这种情况下我该怎么做
答案 0 :(得分:1)
当您尝试安装供应商时,它似乎无法通过git:protocol与github.com联系,这就是为什么它说无法使用9418端口联系,这是git协议使用的端口。这可能是由于某些防火墙阻止此端口或任何类似原因。因为它无法下载SonataAdmin代码,这就是你得到所有其他错误的原因。
你可以做的是用http:protocol替换git:protocol,它也可以用来访问github。所以只需将你的代表改为:
[SonataAdminBundle]
git=http://github.com/sonata-project/SonataAdminBundle.git
target=/bundles/Sonata/AdminBundle
version=origin/2.0
它应该有效