我在Sonata Admin Bundle中安装了Symfony 2.8:
"sonata-project/admin-bundle": "2.4.*@dev",
"sonata-project/doctrine-orm-admin-bundle": "^2.3"
Sonata管理员已成功安装并可在http://xxxxx.com/admin访问,但它无法加载JS和CSS文件(我收到错误404)。这些文件位于web / bundles文件夹中:
drwxr--r-- 2 rabotnici rabotnici 4096 Dec 13 01:44 ./
drwxr-x--- 4 rabotnici nobody 4096 Dec 13 01:13 ../
lrwxrwxrwx 1 rabotnici rabotnici 91 Dec 13 01:44 framework -> /home1/rabotnici/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Resources/public/
lrwxrwxrwx 1 rabotnici rabotnici 68 Dec 13 01:44 sonataadmin -> /home1/rabotnici/vendor/sonata-project/admin-bundle/Resources/public/
lrwxrwxrwx 1 rabotnici rabotnici 67 Dec 13 01:44 sonatacore -> /home1/rabotnici/vendor/sonata-project/core-bundle/Resources/public/
还有什么要配置的吗?
当我尝试从浏览器打开CSS并得到错误404时,这是prod.log的结果:
No route found for "GET /bundles/sonatacore/vendor/ionicons/css/ionicons.min.css
答案 0 :(得分:1)
我在Apache的error_log中发现了问题,web / bundles中的.htaccess文件的权限错误,我只是将其删除了。