Artur Nawrot
Artur Nawrot

Reputation: 493

file_put_contents(...): failed to open stream: No such file or directory

I want to move my website to the internet, but when I open any page, I get an error:

"file_put_contents(D:\htdocs\hack\storage\framework/sessions/qIbfOPu18UZp84iznUbuBeogind3RymGAdXPXdST): failed to open stream: No such file or directory"

I tried to change permissions of some folders, generate a new key, clear cache, remove files in bootstrap/cache, but these ways did not help :(

Any ideas?

Thank you :)

Here is the working solution to upload laravel project on 000webhost hosting

https://www.000webhost.com/forum/t/deploy-laravel-project-into-000webhost-site/127323

Upvotes: 5

Views: 15765

Answers (3)

handsomedev19
handsomedev19

Reputation: 81

There can be various reasons why that error happened.

  1. Try to delete all cached files.
    rm -rf bootstrap/cache/config.php
    php artisan config:clear
    php artisan cache:clear
    php artisan config:cache

  2. If the above actions does not work, then try this again.
    Give permission to the directories in storage directory: app, framework, logs

    sudo chmod -R 777 storage/app
    sudo chmod -R 777 storage/framework
    sudo chmod -R 777 storage/logs

Upvotes: 3

Nasser Ali Karimi
Nasser Ali Karimi

Reputation: 4663

php artisan config:cache Run this command to fix your cache configuration.

This one exactly working for myself because in my case I haven't access to cPanel through SSH, so the bellow fixed my problem.

You can delete the bootstrap/cache/config.php file.

Upvotes: 5

drdhnrq
drdhnrq

Reputation: 39

What permission are you put in the bootstrap and storage folder? Try put 755 permission in this folders and change group for you user:www-data

Upvotes: 3

Related Questions