Unable to write cache symfony2

前端 未结 3 572
感情败类
感情败类 2021-01-23 02:23
RuntimeException in ClassCollectionLoader.php line 239: 

Failed to write cache file \"/var/www/fareast/app/cache/dev/classes.php\".

I have this error

3条回答
  •  逝去的感伤
    2021-01-23 02:41

    You have to use the following script to determine your web server user and grant the needed permissions:

    rm -rf var/cache/*
    rm -rf var/logs/*
    HTTPDUSER = `ps axo user,comm | grep -E '[a]pache|[h]ttpd|[_]www|[w]ww-data|[n]ginx' | grep -v root | head -1 | cut -d\  -f1`
    sudo chmod -R +a "$HTTPDUSER allow delete,write,append,file_inherit,directory_inherit" var
    sudo chmod -R +a "`whoami` allow delete,write,append,file_inherit,directory_inherit" var
    

提交回复
热议问题