【问题标题】:Laravel file_exists(): open_basedir restriction in effect in shared HostLaravel file_exists():open_basedir 限制在共享主机中生效
【发布时间】:2018-05-24 05:31:53
【问题描述】:

大家好,我们使用 laravel 框架开发项目,在本地和 vps 服务器上一切正常,当我们想将项目移动到共享主机时,我们只需移动项目文件并清除缓存文件并在 env 文件中设置数据库配置文件,但是刷新网站时,我们会遇到错误:

file_exists():open_basedir 限制生效。 文件(/home/loca/domains/loca.cf/libs/storage/framework/sessions/JPdCM3pG7UDe6fIPXwyxSzfCRJuqCAn8xYDXRW7B) 不在允许的路径内: (/home/amenc/:/tmp:/var/tmp:/usr/local/lib/php/:/usr/local/php56/lib/php/)

我们的 php 版本是 7,但主机版本是 5.6,这是 make 问题吗? 我们尝试了两天多的时间来解决这个问题,但我们无法帮助我们上传网站,非常感谢:)

【问题讨论】:

    标签: php laravel laravel-5.5 php-7


    【解决方案1】:

    Laravel 5.5 需要 PHP 7 或更高版本。您需要将您的 PHP 升级到版本 7。如果升级后问题仍然存在,请尝试使用 php artisan cache:clear 清除缓存并确保 web server user 可以访问 laravel /storage 目录。

    https://laravel.com/docs/5.5#server-requirements

    【讨论】:

      【解决方案2】:

      需要 PHP 7,但还要仔细检查所有正确复制的 /storage 文件夹,并且 laravel 的权限是可写的以写入这些文件夹

      【讨论】:

        猜你喜欢
        • 2016-03-16
        • 2015-03-30
        • 2019-08-07
        • 1970-01-01
        • 1970-01-01
        • 2012-05-02
        • 1970-01-01
        • 2020-12-21
        • 1970-01-01
        相关资源
        最近更新 更多