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 里面
lnmp环境运行laravel open_basedir restriction in effect 问题的更多相关文章
- 使用宝塔配置laravel站点时,遇到open_basedir restriction in effect. 原因与解决方法
今天一位朋友在linux服务器部署thinkphp5的时候PHP报了这个错误,如下: Warning: require(): open_basedir restriction in effect. F ...
- php 环境require(): open_basedir restriction in effect 错误
php 环境require(): open_basedir restriction in effect 错误 错误日志显示,访问脚本不在 open_basedir的限定目录里面 解决方法打开fastc ...
- LNMP - Warning: require(): open_basedir restriction in effect错误解决方法
LNMP 1.4或更高版本如果不想用防跨目录或者修改.user.ini的防跨目录的目录还需要将 /usr/local/nginx/conf/fastcgi.conf 里面的fastcgi_param ...
- thinkPHP5配置nginx环境无法打开(require(): open_basedir restriction in effect. File(/mnt/hgfs/root/tp5/thinkphp/start.php) is not within the allowed path(s)
今天想把玩一下tp5,结果怎么都无法访问,每次都是报500错误,我把错误提示都打开看到下面的错误 require(): open_basedir restriction in effect. File ...
- require(): open_basedir restriction in effect. 解决方法
在linux服务器部署thinkphp5的时候PHP报了这个错误, 如下: Warning: require(): open_basedir restriction in effect. File(/ ...
- require(): open_basedir restriction in effect. File
新安装的 lnmp 环境,将项目放上报 require(): open_basedir restriction in effect. File 的错误! 错误日志显示,访问脚本不在 open_base ...
- open_basedir restriction in effect,解决php引入文件权限问题 解决方法
如下: 出现问题的原因: 查看问题描述以及资料,发现是php open_basedir 配置的问题,PHP不能引入其授权目录上级及其以上的文件: 一般情况下是不会出现这种问题的,之所以出现这个问题绝大 ...
- PHPExcel中open_basedir restriction in effect的解决方法
用PHPExcel做导出execl的时候发现在本地没有问题,但是把网站传到租用的服务器的时候就报错,具体如下: Warning: realpath() [function.realpath]: ope ...
- open_basedir restriction in effect. File() is not within the allowed path(s)
目前发现eaccelerator安装之后如果php.ini中设置open_basedir将导致open_basedir的一些报错(open_basedir restriction in effect. ...
随机推荐
- Executor等系列概念介绍
这里对几个常见的的名词进行介绍 Executor 这是个接口,只声明了一个方法—— public interface Executor { void execute(Runnable command) ...
- python_12(并发编程)
第1章 进程 1.1 队列Queue 1.2 Queue方法 1.2.1 q.get([block [,timeout]]) 1.2.2 q.get_nowait() 1.2.3 q.put(item ...
- LeetCode 100 及 101题
100. 相同的树 给定两个二叉树,编写一个函数来检验它们是否相同. 如果两个树在结构上相同,并且节点具有相同的值,则认为它们是相同的. 示例 1: 输入: 1 1 / \ / \ 2 3 2 3 [ ...
- RK3288开发过程中遇到的问题点和解决方法之Devices
分区大小和“多用户支持” \device\rockchip\common\BoardConfig.mk BUILD_WITH_UMS ?= true改为BUILD_WITH_UMS ?= false ...
- java文件读写链接流向
1)字节流 读写的链接流向源节点->FileInputStream->BufferedInputStream->ObjectInputStream->程序 程序->Obj ...
- 线程池 Threadlocal 使用注意
线程池中的线程是重复使用的,即一次使用完后,会被重新放回线程池,可被重新分配使用. 因此,ThreadLocal线程变量,如果保存的信息只是针对一次请求的,放回线程池之前需要清空这些Threadloc ...
- C#语言基础 Main 函数中变量 整型
在我们每次上网或者用电脑的时候,请输入你的xxx 或者你的名字(年龄/身高/学校/籍贯)是 在这里我们就要学到一些变量,就是不确定的东西 string a: //赋予变量 a ="内容& ...
- 洛谷 P2936 [USACO09JAN]全流Total Flow
题目描述 Farmer John always wants his cows to have enough water and thus has made a map of the N (1 < ...
- scanf("%s",s)与gets(s)
#include <stdio.h> void fun(char s[]) {; while(s[i]!='\0') {i++;} printf("%d",i);} v ...
- java 核心技术卷一笔记 6 .2接口 lambda 表达式 内部类
6.2 接口实例 6.2.1 接口与回调 在java.swing包中有一个Timer类,可以使用它在到达给定的时间间隔时发出通告,假如程序中有一个时钟,就可以请求每秒钟获得一个通告,以便更新时钟的表盘 ...