logs/laravel.log could not be opened.
See original GitHub issueThe stream or file “/var/task/user/storage/logs/laravel.log” could not be opened: failed to open stream: Read-only file system
Hi @f3l1x, I got error message when deploy laravel project that depends on log file. Here’s the screenshot.
Here’s the site: https://phpbali-site-o7r82chhh.vercel.app
This log file is a part of settings in https://github.com/GrKamil/laravel-telegram-logging package. When I set LOG_CHANNEL to stack in vercel.json file it throws error like image above.
Here’s my vercel.json config:
{
"version": 2,
"builds": [
{ "src": "/api/index.php", "use": "vercel-php@0.3.1" },
{ "src": "/public/**", "use": "@vercel/static" }
],
"routes": [
{
"src": "/(css|js)/(.*)",
"dest": "public/$1/$2"
},
{
"src": "/(.*)",
"dest": "/api/index.php"
}
],
"env": {
"APP_ENV": "production",
"APP_DEBUG": "true",
"APP_URL": "https://yoursite.com",
"APP_CONFIG_CACHE": "/tmp/config.php",
"APP_EVENTS_CACHE": "/tmp/events.php",
"APP_PACKAGES_CACHE": "/tmp/packages.php",
"APP_ROUTES_CACHE": "/tmp/routes.php",
"APP_SERVICES_CACHE": "/tmp/services.php",
"VIEW_COMPILED_PATH": "/tmp/views",
"SSR_TEMP_PATH": "/tmp/ssr",
"CACHE_DRIVER": "array",
"LOG_CHANNEL": "stack",
"SESSION_DRIVER": "cookie",
"NODE_PATH": "node"
}
}
I thought that I’m missing additional configuration on “env” in vercel.json file.
Issue Analytics
- State:
- Created 3 years ago
- Comments:6
Top Results From Across the Web
How to fix Error: laravel.log could not be opened?
I fixed this problem simply by giving the necessary permission to my folders. Right Click on the logs folder and click on Get...
Read more >How to fix error laravel log could not be opened in append ...
This error occurs because the web server is unable to write into the error logs in the storage folder. Since, the web server...
Read more >The stream or file "/storage/logs/laravel.log" could not be ...
laravel - The stream or file "/storage/logs/laravel.log" could not be opened in append mode: failed to open stream: Permission denied.
Read more >How to fix Error: laravel.log could not be opened? - Tuts Make
In this tutorial, you will learn, how to solve storage/logs/laravel.log” could not be opened: failed to open stream: permission denied.
Read more >Project Maintainer Edit - For Laravel Developers - GitHub
Permission denied ".../storage/logs/laravel.log could not be opened" #436. viewty opened this issue on Jul 14, 2017 · 19 comments ...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

Hi @satyakresna. There is only 1 writable folder,
/tmp. You should change log directory, to the/tmpfolder.@f3l1x Yes I understand that, but by default Laravel uses the
/storage/logspath and Vercel needs this to be re-routed to/tmpbut i’m not sure where you do this in Laravel?