Error Exception file put contents failed to open stream No such file or directory in Laravel

+1 vote

Hii,

Laravel show me two ErrorException

file_put_contents(G:\project\storage\framework\views/751d8a0fd8a7d4138c09ceb6a34bb377aa2d6265.php):
failed to open stream: No such file or directory

and

file_put_contents(G:\project\storage\framework/sessions/aIXycR4LIAUBVIqZu0T590paOMIpV8vfZGIroEp0):
failed to open stream: No such file or directory

How to solve this problem?

Mar 31, 2020 in Laravel by kartik
• 37,520 points
48,821 views

3 answers to this question.

+1 vote

Hello,

You should typically run the php artisan config:cache command as part of your production deployment routine. As a solution to your problem, I suggest you

  • Recreate the cache file, for faster configuration loading

To do this, run the following Artisan commands on your command line

  • php artisan config:cache

Where you don't have access to the command line on your server, you can programmatically execute the command by adding the following to your routes:

Route::get('/clear-cache', function() {
    $exitCode = Artisan::call('config:cache');
    return 'DONE'; //Return anything
});

And then call the clear-cache route from your browser.

I hope this is helpful.

answered Mar 31, 2020 by Niroj
• 82,840 points
0 votes
The best way to solve this problem is, go to directory "laravel/bootstrap/cache" and delete config.php file. or you can rename it as well like config.php.old And your problem will be fix.
answered Sep 14, 2020 by Esita
• 180 points
0 votes
It  sounds like a permission issue. A new IP would create a new cache file, and the new file perhaps is being set to a default mask that can't be accessed.

When you connect with a new IP, check the cache directories for the new file.. what is its permission setting?

You could also try running this command to determine the default umask:

getfacl storage/framework/*
answered Oct 1, 2020 by Jay
• 150 points
I have tried but still not resolved please help

Hello @Franklin,

Have you tried my solution? if still it doesn't work you can try cleaning the cache "php artisan cache:clear" 

Let me know if it helps!

Related Questions In Laravel

0 votes
2 answers

Error:Failed to open stream: Permission denied in Laravel?

I had this problem lately with my ...READ MORE

answered Nov 4, 2020 in Laravel by anonymous
• 140 points
16,891 views
0 votes
1 answer

The stream or file "/var/www/storage/logs/laravel.log" could not be opened: failed to open stream: Permission denied

Hello @kartik, Make your Dockerfile something as below ...READ MORE

answered Sep 30, 2020 in Laravel by Niroj
• 82,840 points
21,472 views
+1 vote
1 answer

Error:file_put_contents(meta/services.json): failed to open stream: Permission denied?

Hello @kartik, Below steps helped me fix the ...READ MORE

answered Apr 3, 2020 in Laravel by Niroj
• 82,840 points
8,669 views
0 votes
2 answers
+1 vote
1 answer

How to make anchor tag with routing using Laravel?

Hey @kartik, First you have to go to ...READ MORE

answered Mar 18, 2020 in Laravel by Niroj
• 82,840 points
23,012 views
0 votes
1 answer

What is redirection in Laravel?

Named route is used to give specific ...READ MORE

answered Mar 18, 2020 in Laravel by Niroj
• 82,840 points
2,994 views
0 votes
1 answer

How to install Laravel via composer?

Hello, This is simple you just need to ...READ MORE

answered Mar 23, 2020 in Laravel by Niroj
• 82,840 points
2,918 views
+1 vote
1 answer

What are named routes in Laravel and How can specify route names for controller actions?

Hey @kartik, Named routing is another amazing feature of ...READ MORE

answered Mar 23, 2020 in Laravel by Niroj
• 82,840 points
44,690 views
0 votes
1 answer

Error:Laravel 5 show ErrorException file_put_contents failed to open stream: No such file or directory

Hello @kartik, The best way to solve this ...READ MORE

answered Aug 10, 2020 in Laravel by Niroj
• 82,840 points
6,496 views
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP