Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

degorych's avatar

Strange cache behavior

Hi all. I tried to install the latest version of laravel on the hosting (first I launched the project locally, then I transferred everything to git and uploaded it to the server from git: git clone, composer install ..). I set up .env, made migrations, changed the DocumentRoot path to path/public, chmod -R 755 storage/ , chown apache:apache storage/ . I did all possible cache clears: php artisan cache:clear, php artisan view:clear, php artisan route:clear, php artisan config:clear. I also did everything in one command, in the hope that this will help php artisan optimize:clear. I also updated composer dump-autoload and composer cc cache just in case. But when I start the application, I get an error accessing the storage/ file (PHP Fatal error: Uncaught ErrorException: file_put_contents(/path-to-progect/storage/framework/views/bedf4f3d369327871f669c8898680c4e.php): Failed to open stream: Permission denied in /path-to-progect/vendor/laravel/framework/src/Illuminate/Filesystem/Filesystem.php...). However, the file (bedf4f3d369327871f669c8898680c4e.php) does not exist. Where does laravel store these settings? How can they be cleaned?

0 likes
3 replies
EricZwart's avatar

Like storage/ you also have to do that with bootstrap/cache

1 like
degorych's avatar
degorych
OP
Best Answer
Level 1

As @ericzwart say, need get access to bootstrap/ and storage/. For me work with 777 rules only, not for 775 chmod 777 -R storage/, chmod 777 -R bootstrap/

EricZwart's avatar

Yes these directory's need to be writable. So you solved it yourself.

Please or to participate in this conversation.