Work with app/console in Symfony at Mac OS X

本小妞迷上赌 提交于 2019-12-04 18:14:07

If you are on Mac you can use ACL as it is explained here. From the project directory:

sudo chmod +a "_www allow delete,write,append,file_inherit,directory_inherit" app/cache app/logs
sudo chmod +a "whoami allow delete,write,append,file_inherit,directory_inherit" app/cache app/logs

_www in the first line is the name of which is running the web server

You have to change whoami in the second line as it is you when you type php app/console cache:clear. (usually the name of your home folder)

Apparently your web server (apache?) already created some files or dirs in the cache folder (so they are owned be the web servers user, probably www-data). In this case a chmod isn't enough, you have to execute a chown -R anton app/cache app/log.

To avoid the general problem of different owners of different cache files, your console user and the user executing php for the web server should be the same. There are different ways to accomplish this. You could:

  1. Change your apache configuration, so the apache runs with your user (anton) rather than www-data
  2. Drop mod_php and use php5-fpm instead (and configure it to use your user)
  3. Use fast_cgi
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!