open_basedir restriction in effect,解决php引入文件权限问题 lnmp
1.配置了虚拟域名
vim /usr/local/nginx/conf/vhost/siemens.conf
server
{
listen 80;
#listen [::]:80 default_server ipv6only=on;
server_name local.siemens.com;
index index.html index.htm index.php;
root /home/wwwroot/default/siemens/new_hotel/Public;
#error_page 404 /404.html;
include enable-php-pathinfo.conf;
location /nginx_status
{
stub_status on;
access_log off;
}
location ~ .*\.(gif|jpg|jpeg|png|bmp|swf)$
{
expires 30d;
}
location ~ .*\.(js|css)?$
{
expires 12h;
}
location ~ /\.
{
deny all;
}
access_log /home/wwwlogs/access.log;
}
2.然后配置hosts
vim /etc/hosts
添加
127.0.0.1 local.siemens.com
然后重启lnmp
sudo lnmp reload 或者restart
结果报500错误, 啥也看不到。
3.开启display_errors查看原因
sudo vim /usr/local/php/etc/php.ini
display_errors = On
然后重启再次访问。
发现还是报错,我都开始怀疑系统环境是不是有问题了。
4.后来发现配置一下目录权限就可以了。
sudo vim /usr/local/nginx/conf/fastcgi.conf
将根目录加入其中就可以了
# PHP only, required if PHP was built with --enable-force-cgi-redirect
fastcgi_param REDIRECT_STATUS 200;
fastcgi_param PHP_ADMIN_VALUE "open_basedir=/home/wwwroot/:/tmp/:/proc/";
完了,重启lnmp服务就ok了。
open_basedir restriction in effect,解决php引入文件权限问题 lnmp的更多相关文章
- open_basedir restriction in effect,解决php引入文件权限问题 解决方法
如下: 出现问题的原因: 查看问题描述以及资料,发现是php open_basedir 配置的问题,PHP不能引入其授权目录上级及其以上的文件: 一般情况下是不会出现这种问题的,之所以出现这个问题绝大 ...
- php错误提示 open_basedir restriction in effect 解决
<VirtualHost *:80> DocumentRoot "D:/www/4w_raaaa_com_2017" ServerName www.raaaa.com: ...
- require(): open_basedir restriction in effect. 解决方法
在linux服务器部署thinkphp5的时候PHP报了这个错误, 如下: Warning: require(): open_basedir restriction in effect. File(/ ...
- open_basedir restriction in effect,解决php引入文件权限问题
一.前言 今天在Ubuntu安装了lnmp环境,运行项目的时候出现了,引入500的错误 二.查看错误 再项目文件入口添加,代码显示错误内容,查看到一下错误 ini_set('display_error ...
- 使用宝塔配置laravel站点时,遇到open_basedir restriction in effect. 原因与解决方法
今天一位朋友在linux服务器部署thinkphp5的时候PHP报了这个错误,如下: Warning: require(): open_basedir restriction in effect. F ...
- 解决 php 报错 open_basedir restriction in effect或者nginx提示No input file specified怎么办
解决 php 报错 open_basedir restriction in effect或者nginx提示No input file specified怎么办 问题是出现在了PHP.INI上面了 ,原 ...
- LNMP - Warning: require(): open_basedir restriction in effect错误解决方法
LNMP 1.4或更高版本如果不想用防跨目录或者修改.user.ini的防跨目录的目录还需要将 /usr/local/nginx/conf/fastcgi.conf 里面的fastcgi_param ...
- 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. ...
随机推荐
- js判断是安卓 还是 ios webview?
通过判断浏览器的userAgent,用正则来判断是否是ios和Android客户端.代码如下: <script type="text/javascript"> var ...
- PMP 学习心得
前两天刚考完 PMP,松了一口气,终于考完了,虽然心里有点慌,不知道自己会不会过.学习 PMP 这三个月还是很充实的.不断的看视频,做题目,功夫不负有心人,也算是学到了一些东西.至少知道了一个项目的启 ...
- 后台工具screen
之前在putty之类的远程命令行操作服务器的时候,遇到关闭软件,对应的操作就会关闭.很多时候,就是开着电脑,然后挂在那里,虽然不用电脑跑,但是也耗电...主要是putty这些软件有时候会伴随黑屏崩掉. ...
- Spring核心技术(五)——Spring中Bean的作用域
前文概述了Spring的容器,Bean,以及依赖的一些信息,本文将描述一下Bean的作用域 Bean的作用域 当开发者定义Bean的时候,同时也会定义了该如何创建Bean实例.这些具体创建的过程是很重 ...
- Java基础学习总结(85)——Java中四种线程安全的单例模式实现方式
- HDU 1249 三角形的分割
可以将三角形的三条边一条一条加进图形中观察 假设添加第n个三角形 前n-1个三角形将区域划分为sum[n-1] 第n个三角形每条边最多能经过前n-1个三角形每条三角形的两条边 , 一条边切完增加了 2 ...
- [K/3Cloud] KSQL 关联表更新字段Update语法
关联表更新字段 UPDATE tmp369faa3f7d224b0595670425008 as t1 SET FStatus=-1 where exists(select 1 from t_BD_S ...
- jsp内置对象(转)
JSP中一共预先定义了9个这样的对象,分别为:request.response.session.application.out.pagecontext.config.page.exception 1. ...
- 高数A(下)第九章
第九章 空间解析几何 9.2 9.3 9.4 自测题
- HTTP自学心得
HTTP是一个 客户端和 服务器端请求和应答的标准(TCP).HTTP是客户端浏览器或其他程序与 Web服务器之间的应用层通信协议. HTTP一般指超文本传输协议,它是互联网应用最广泛的协议,是用于从 ...