Symfony2 + SonataAdmin - assets not loading

纵然是瞬间 提交于 2019-12-12 02:58:59

问题


I have Symfony 2.8 installed with Sonata Admin Bundle:

"sonata-project/admin-bundle": "2.4.*@dev",
"sonata-project/doctrine-orm-admin-bundle": "^2.3"

The Sonata admin is successfully installed and accessible at http://xxxxx.com/admin, but It can't load JS and CSS files (I get error 404). The files live in web/bundles folder:

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/

Is there anything more to be configured?

When I try to open the CSS from the browser and I get error 404, here is the result of the prod.log:

No route found for "GET /bundles/sonatacore/vendor/ionicons/css/ionicons.min.css


回答1:


I Found the problem in the Apache's error_log, the file .htaccess in web/bundles was with wrong permissions, I just removed it.



来源:https://stackoverflow.com/questions/34246630/symfony2-sonataadmin-assets-not-loading

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