After executing
php artisan config:cache
php artisan cache:clear
The application doesn't work anymore, it seems to be something about the session. Stopped create the session files.
The error returning is:
file_put_contents(path/to/file/storage/framework/sessions/PullrofroFB2gGJNA8v7Zo7OcdTzno4ZDTVmfBBi):
failed to open stream:
No such file or directory
The config:cache and the cache:clear don't refer to the same cache.
If you run php artisan config:cache --help shows the following description:
Description: Create a cache file for faster configuration loading
Running php artisan cache:clear --help shows the following description:
Description: Flush the application cache
And there's also another command: config:clear which
Description: Remove the configuration cache file
So... cache:clear only clears the application cache while config:clear will remove the cache file created by config:cache. Also you may try running config:cache whith admin privileges.
Related
I have a Laravel project (v8.12) running on PHP 7.4.3 in a dedicated AWS instance with Ubuntu 20.04. When I try to read an environment variable from inside a job, the value is always null, but it works elsewhere. I tried to switch from supervisord to sync driver, still couldn't reach it.
Your problem could be from cache .
you can below commands for remove cache .
php artisan cache:clear
php artisan config:clear
php artisan view:clear
Run below commands
composer dump-autoload
php artisan clear-compiled
php artisan optimize
php artisan route:clear
php artisan view:clear
php artisan cache:clear
php artisan config:cache
php artisan config:clear
For Example
In your env file
SITE_NAME="My website"
Get your env variable like
$data = env('SITE_NAME');
echo $data;
I am trying to configure a new laravel project however I always get the following error no matter what:
file_put_contents(C:\Users\bla...\Documents\GitHub\project\storage\framework/sessions/yB2Ji8maEDu0fXZLpZ5VBnDzIhLdaeA7aYdVMjOf): failed to open stream: No such file or directory
I have tried re installing homestead/laravel/vagrant I have also ran the following and more artisan command again and again:
php artisan config:cache
php artisan cache:clear
php artisan optimize
I have also ran chmod privileges on files/folders inside of my vagrant box but still nothing gets me past this error, any ideas? The project itself is created perfectly fine inside of my vm.
Delete all the files in yourProject/storage/framework/sessions, then run php artisan view:clear and php artisan config:clear
I'm using laravel 5.5. Recently I have disabled ssl for my site. So I just edited .env file and set APP_URL as http://www.example.com instead of https://www.example.com. But when ever I try access url inside my code it returns with https as previously. for eg url('sample_route') returns https://www.example.com/sample_route. I have tried clearing cache and configs through artisan commands. but still getting same result.
You can try command composer dump-autoload too with cache & config clear command.
Have you tried all php artisan commands in clearing caches?
php artisan route:clear
php artisan config:cache
php artisan cache:clear
php artisan view clear
I have a problem with my project laravel 5.7. I have developed it locally and all is well but once sent to my server online I have this error: view [auth.login] not found.
Ran into the same problem. I noticed three things;
A message while booting homestead about virtualbox guest-tools being out of sync between host and guest. There could be a problem with paths. I fixed that issue with the help of this here
The Laravel view [auth.login] not found on server page displayed the path of the host machine and not of the vagrant-guest.
bootstrap/cache/config.php also displayed paths from the host and not the guest.
Renaming/deleting (or artisan cache:clear) the config.php only gave errors (Laravel Error “Unable to load the ”app“ configuration file”).
I fixed the issue by correcting the paths in config.php manually to the correct path in vagrant.
Run following commands on your server.
it might solve your problem.
php artisan config:clear
php artisan cache:clear
php artisan view:clear
php artisan route:cache
php artisan optimize
or
composer dump-autoload -o
if you are in develop mode you can run:
php artisan config:clear
or if you are in product mode you can run:
php artisan config:cache
notice: when you use second, config clear and cache again and you force to repeat command for other changes.
I am trying to setup a deployment script for my Laravel 5 app to use with CodeShip but I am having issues with clearing the application cache during the deployment.
By running
php artisan cache:clear
it does not give any errors and says the cache has been cleared but it hasnt, then when I ssh into the box and try to delete the cache manually it says permission is denied, so I need to use sudo which is not ideal as Id like to have this all to run without my intervention. I know this is a permissions issue but I cannot work out a way around it.
Is there a way I can do this or maybe a slightly different method?
You shouldn't delete cache manually. Try to run these commands:
php artisan cache:clear
php artisan view:clear
php artisan route:clear
php artisan config:clear
composer dump-autoload
Try php artisan config:cache
This will do it all for you.
Hope this helps!