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. ...
随机推荐
- GEO/SRA数据库
GEO数据库 GEO数据库隶属于NCBI,是最大最全面的基因表达数据库,主要是芯片和转录组测序数据.除储存数据外,也提供一些数据挖掘工具,因此利用好这个数据库,没有实验,没有自己的数据也能发好文章! ...
- blog笔录1
(1)虚拟主机 (2)部署 部署完成后刷新页面会看到笑脸,在Home分组下控制器Application/Home/Controller/IndexController.class.php下定义显示 ( ...
- vue启动
首先在终端terminal连上npm 镜像库 npm config set registry https://registry.npm.taobao.orgnpm installnpm run loc ...
- time模块,补上之前拉下的作业。
time,时间模块比较重要,但不难学,主要是要学会转换时间格式.计算机的时间都是时间戳.人是看不懂的.写出时间转换的固定格式语句.import time # 首先就是引入时间模块. time.ti ...
- java基础学习日志--String、StringBuffer方法案例
package StringDemo; import java.util.Arrays; /* * 常用String.StringBufer类的方法 */ public class Demo1 { p ...
- UVA - 11214 Guarding the Chessboard(迭代加深搜索)
题目: 输入一个n*m的棋盘(n,m<10),某些格子有标记,用最少的皇后守卫(即占据或攻击)所有的标记的格子.输出皇后的个数. 思路: 一开始没有想到用迭代加深搜索,直接dfs结果还没写完就发 ...
- 39页第7题 计算2的i次方之和
/*计算2的i次方之和*/ #include<stdio.h> #include<math.h>/*调用math.h文件中的函数*/ int main(void) { int ...
- virtualenv与virtualenvwrapper
一.Linux下安装.配置virtualenv pip3 install virtualenv # 创建虚拟环境env1 virtualenv env1 --no-site-packages --py ...
- Linux:Apache改静态网页、个人用户主页、虚拟网站主机、Apache访问控制
Apache改静态网页 1.概述: Apache是web服务器(静态解析,如HTML),tomcat是java应用服务器(动态解析,如JSP.PHP) Tomcat只是一个servlet(jsp也翻 ...
- 三 , lnmp 一键包安装使用
安装打包环境 #https://lnmp.org/----------------------------------------------------#安装wget -c http://soft ...