'Laravel file_put_contents error on shared hosting
I created my Laravel app and I am uploading on shared hosting. It's show error:
file_put_contents(D:\xampp\htdocs\Laravel\storage\framework/sessions/FlEPsHNW7Rggfb9wvDZ71K7D2YQNNQK0epRBRQnW): failed to open stream: No such file or directory
This is folder from my computer. I read same problems but I am on shared hosting and I don't have a composer or artisan for operations.
Thanks in advance!
Solution 1:[1]
I had the same issue here.
I tried to run php artisan config:cache but it didn't work out
Then I delete all my sessions in /myprojectname/storage/framework/ but still didn't work out on shared hosting but worked fine on localhost.
Here's what worked:
I delete the cache folder in /myprojectname/bootstrap/ and ran the application and got this error:
Exception thrown with message "The /hosthome/hostuser/myprojectname/bootstrap/cache directory must be present and writable."
I then made a new cache folder in /myprojectname/bootstrap/ and ran the site and it was up
in short terms
Navigate to your projects
/bootstrap/cache/folder.Delete the contents of the directory and your good to go ?
Solution 2:[2]
Change config path and make sure storage folder has correct permission Directory Permissions
After installing Laravel, you may need to configure some permissions. Directories within the storage and the bootstrap/cache directories should be writable by your web server or Laravel will not run. If you are using the Homestead virtual machine, these permissions should already be set.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | zonecc |
| Solution 2 | San K |
