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. ...
随机推荐
- Shell输入/输出重定向
输出重定向 重定向一般通过在命令间插入特定的符号来实现.特别的,这些符号的语法如下所示 command1 >file1 上面这个命令执行command1然后将输出的内容存入file1. 注意任何 ...
- webpack常见问题
概念问题一:什么是webpack和grunt和gulp有什么不同 答案:Webpack是一个模块打包器,他可以递归的打包项目中的所有模块,最终生成几个打包后的文件.他和其他的工具最大的不同在于他支持c ...
- freemarker使用map替换ftl中相关值
ftl文件demo01.ftl <html> <head> <title>Welcome!</title> </head> <body ...
- iOS-关于一些手势冲突问题(scrollView 嵌套 tableView)
简单说下关于开发中容易遇到的父试图添加手势与子试图点击事件冲突,UIScrollView 嵌套 UIScrollView . UIScrollView 嵌套 UITableView的情况手势冲突问题: ...
- react antD moment
import moment from 'moment' console.log(moment().add(1, 'days').format('YYYY-MM-DD')) //当前时间前一天 cons ...
- <MySQL>入门三 数据定义语言 DDL
-- DDL 数据定义语言 /* 库和表的管理 一.库的管理:创建.修改.删除 二.表的管理:创建.修改.删除 创建:create 修改:alter 删除:drop */ 1.库的管理 -- 库的管理 ...
- Linux学习笔记记录(二)
- c#读取.config文件内容
今天在做项目的时候,由于程序同时启动多种情况的数据,测试分为多个人,就需要把数据分离开来,于是用了一个临时的配置文件,让测试在配置文件修改相应数据从而让各个测试互相不影响! 步骤: 第一步:添加一个A ...
- JavaScript 面向对象的编程(二) 类的封装
类的定义 方式一 var Book = function(id, name, price){ //私有属性,外部不能直接访问 var num = 1; //私有方法, function checkId ...
- 【Codeforces 1118D1】Coffee and Coursework (Easy version)
[链接] 我是链接,点我呀:) [题意] 题意 [题解] 从小到大枚举天数. 然后贪心地,从大到小分配a[i]到各个天当中. a[n]分配到第1天,a[n-1]分配到第2天,...然后a[n-x]又分 ...