Search code examples
symfonysonata-adminsymfony-2.8

Symfony2 + SonataAdmin - assets not loading


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

Error404 loading assets of Sonata Admin


Solution

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