首页 > 解决方案 > file_put_contents(C:\Users\FNRI\Desktop):无法打开流:没有这样的文件或目录

问题描述

clear:cache在 000webhoso 中部署 laravel 项目时,如何使用 php artisan 之类的命令?

我尝试配置但仍然找不到解决方案

我需要使用迁移清除日志和缓存

php artisan clear:cache

错误:

file_put_contents(C:\Users\FNRI\Desktop\final\storage\framework/sessions/Jutrm2SkTQTO8H0jB1wnGXm5y8HUd7siBBtjh8Jz):无法打开流:没有这样的文件或目录

加载我的项目

标签: phplaraveldeploymentdirectorystorage

解决方案


转到目录bootstrap > cache > config.php删除 config.php 文件。

如果你想打电话,php artisan clear:cache那么你也可以创建它的路由文件

Route::get('/clear-cache', function() {
  Artisan::call('cache:clear');
            // return what you want
});
Route::get('/clear-view', function() {
  Artisan::call('view:clear');
            // return what you want
});
Route::get('/clear-config', function() {
  Artisan::call('config:clear');
            // return what you want
});

运行为

  • domainname.com/clear-cache
  • domainname.com/clear-view
  • domainname.com/clear-config

推荐阅读