Reputation: 674
so i keep getting this error on my live server but not on my local host, everything works normal on my localhost but when i deploy my website on online server it keep giving me this error
file_put_contents(C:\appname\storage\framework\views/27f511f5644086daa68b2cf835bf49f5148aba43.php): failed to open stream: No such file or directory
i tried php artisan config:cache
but nothing really worked
Upvotes: 2
Views: 6055
Reputation: 614
I solved with these commands:
sudo chgrp -R www-data storage bootstrap/cache
sudo chmod -R ug+rwx storage bootstrap/cache
Upvotes: 0
Reputation: 3594
I suppose your issue is due to the Laravel Configuration Caching.I suggest you
To do this, run the following Artisan commands on your command line
Where you don't have access to the command line on your server, you can programmatically execute commands like this:
Route::get('/clear-cache', function() {
$exitCode = Artisan::call('config:clear');
$exitCode = Artisan::call('cache:clear');
$exitCode = Artisan::call('config:cache');
return 'DONE'; //Return anything
});
I hope this is helpful.
Upvotes: 3
Reputation: 672
Looks like your storage/ directory is not writable. Laravel requires that directory to be writable.
If you're on linux/mac, run this
chmod 0755 storage/ -R
Hope that helps.
Upvotes: 0
Reputation: 993
I'm going to guess that you have the wrong path being used, so try this to ensure that regardless of the server, you will have the right path:
$path = dirname(__FILE__);
file_put_contents($path.DIRECTORY_SEPARATOR.'27f511f5644086daa68b2cf835bf49f5148aba43.php');
This assumes that you are trying to write to the same folder as the code file that is running this.
You can also use the following to determine exactly what the path is on each server:
echo getcwd();
Upvotes: 0
Reputation: 469
Try and use next command "php artisan cache:clear"
will help you to clear cache for app
Upvotes: -1