• lnmp环境运行laravel open_basedir restriction in effect 问题


    环境配置:centos 7 ; php 7.1.5

    Warning: require(): open_basedir restriction in effect. File(/home/wwwroot/default/laravel/bootstrap/autoload.php) is not within the allowed path(s): (/home/wwwroot/default/laravel/public/:/tmp/:/proc/) in /home/wwwroot/default/laravel/public/index.php on line 22

    Warning: require(/home/wwwroot/default/laravel/bootstrap/autoload.php): failed to open stream: Operation not permitted in /home/wwwroot/default/laravel/public/index.php on line 22

    Fatal error: require(): Failed opening required '/home/wwwroot/default/laravel/public/../bootstrap/autoload.php' (include_path='.:/usr/local/php/lib/php') in /home/wwwroot/default/laravel/public/index.php on line 22

    解决方法:

    如果你是PHP 5.3.3以上的版本,可以修改/usr/local/php/etc/php.ini在末尾里加入:

    [HOST=www.project.com]
    open_basedir=/home/wwwroot/default/laravel/:/tmp/
    [PATH=/home/wwwroot/default/laravel/public]
    open_basedir=/home/wwwroot/default/laravel/:/tmp/

    按上面的这个例子修改,换成你自己的域名和目录,多个网站就按上面的例子改成多个,最后重启php-fpm:/etc/init.d/php-fpm restart

    上面路径地址 不需要到 public  里面

  • 相关阅读:
    POJ3264 线段树模板
    Dijkstra算法模板 C++
    POJ 1287 Prim算法模板
    ZOJ 2107 Quoit Design(分治法解最近对模板题)
    POJ 3714 Raid 分治法求最近对问题
    最长上升子序列(LIS)及其优化O(nlongn)
    PAT1146 Topological Order
    PAT甲级 _A+B Format
    PAT乙级_A+B与C
    PAT乙级_继续3n+1猜想
  • 原文地址:https://www.cnblogs.com/zouzhe0/p/7149823.html
Copyright © 2020-2023  润新知