简体   繁体   中英

Access forbidden in /web directory Symfony2 project

I'm working on a Symfony2 project at local server without any virtual hosting or something else. After I run the command php app/console assets:install --symlink , clear the cache and refresh the page none styles or javascript or images are loaded. Inspecting the source code and trying to access any of those assets I get this error:

You don't have permission to access /cmplatform/web/bundles/clanmovilcommon/css/bootstrap.min.css on this server.

What I need to change in my /etc/httpd/conf/httpd.conf to fix that problem? It's related to .htaccess problem or what?

This error is due to the user that you are currently logged in as not having correct to write to the /cmplatform/web directory. Or you have not got the root path set correctly in your apache.conf.

Can you confirm other pages / assets are being served correctly.

Take a look at who owns the directory and either adjust the write permissions or add your user / web server to own the directory or into the group.

This is quite a common issue - and care needs to be taken to ensure that write permissions for web, cache and log directories are set correctly to allow command line and web server (eg apache / nginx) users.

See http://symfony.com/doc/current/book/installation.html - permissions for some tips about fixing this.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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