laravel 5 打开页面报错

查看:179
本文介绍了laravel 5 打开页面报错的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

问 题

有2个疑问:
1.本地php artisan serve 可以
2.不知道为什么移动服务器之后,会去创建或者读取/目录的文件,所以没有权限,报错
3.是权限目录,也777过目录,但是这里应该不是单纯的权限,因为程序不可能去读/,都是用相对目录的,但是不知道哪里用了这个绝对目录

ErrorException in Filesystem.php line 109:
file_put_contents(/b53e72be8b40e01b5dd6a10f6254791b9c073338.php): failed to open stream: Permission denied

已经尝试过:

php artisan clear-compiled
php artisan optimize      
php artisan cache:clear

解决方案

找到问题了. 如果没有views目录的话,就会去根目录

Filesystem.php,如果没有传path的话,就会空了...

 public function put($path, $contents, $lock = false)
    {
        return file_put_contents($path, $contents, $lock ? LOCK_EX : 0);
    }

之前迁移过来删掉了整个 storage目录,现在重建的时候忘了重建views目录

  /*
    |--------------------------------------------------------------------------
    | Compiled View Path
    |--------------------------------------------------------------------------
    |
    | This option determines where all the compiled Blade templates will be
    | stored for your application. Typically, this is within the storage
    | directory. However, as usual, you are free to change this value.
    |
    */

    'compiled' => realpath(storage_path('framework/views')),

这篇关于laravel 5 打开页面报错的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆