【问题标题】:i have an issue with my laravel 5 project i can't find the way to run my project on my local machine我的 laravel 5 项目有问题我找不到在本地机器上运行我的项目的方法
【发布时间】:2021-11-17 10:31:27
【问题描述】:

127.0.0.1:8000> [2021 年 9 月 24 日星期五 10:46:12] PHP 致命错误:未捕获的 ErrorException:file_put_contents(/var/www/html/mpm/storage/framework/views/9573eb5dc606d0d2f327fdda9ed9d4ecfd5f1e97.php):无法打开流:没有这样的文件或目录在 C:\xampp\htdocs\amit\mpmnew\mpm20sept2021\mpm\vendor\laravel\framework\src\Illuminate\Filesystem\Filesystem.php:122

这是我的错误,谁能帮帮我。

【问题讨论】:

  • 清除缓存
  • 执行工匠命令cache clearconfig clear
  • 这看起来很奇怪。为什么您的应用程序尝试在 Windows 系统上写入 /var/www
  • 只是一个提示:XAMPP 可能不是运行 Laravel 应用程序的最佳选择。有更好的选择,例如php artisan serve。在 Windows 上没有 /var/www/。您是否复制了包括缓存文件夹在内的整个应用程序?
  • 请提供足够的代码,以便其他人更好地理解或重现问题。

标签: laravel laravel-5


【解决方案1】:
php artisan cache:clear
php artisan config:cache

您可以通过将以下内容添加到您的路由以编程方式执行该命令:

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

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2011-04-05
    • 1970-01-01
    • 2022-10-24
    • 2014-01-09
    • 1970-01-01
    • 1970-01-01
    • 2021-08-09
    相关资源
    最近更新 更多