I got this continuous error with cache. Something with permissions but I can't figure what's going on. In my local environment when I go a php bin/console cache:clear -e=dev it return me this
[Symfony\Component\Filesystem\Exception\IOException]
Failed to remove file "/project/var/cache/de~/pools/ORsqbHaOKl/L/K/iZULk48B-k00dzIKC2qg": unlink(/project/var/cache/de~/pools/ORsqbHaOKl/L/K/iZULk48B-k00dzIKC2qg): Permission denied.
So I need to make first a chmod -R 777 var/, then again the clear cache and it works. But when I run the website it return me
Failed to create "/project/var/cache/dev/tcpdf": mkdir(): Permission denied.
So I need again to make chmod -R 777 var/
In the production server without erasing anything sometimes i get this error
Warning: rename(C:\project\var\cache\prod/doctrine/orm/Proxies\__CG__AppBundleEntitySomeEntity.php.5a142ad84e8464.47105642,C:\project\var\cache\prod/doctrine/orm/Proxies\__CG__AppBundleEntitySomeEntity.php): Access is denied. (code: 5)
error in vendor\doctrine\common\lib\Doctrine\Common\Proxy\ProxyGenerator.php (line 309 rename())
$tmpFileName = $fileName . '.' . uniqid('', true);
file_put_contents($tmpFileName, $proxyCode);
@chmod($tmpFileName, 0664);
rename($tmpFileName, $fileName);
}
Local environment: debian 9 Production environment: windows server 2008