Centos6.x/7.x LNMP 环境安装常见错误集锦
2015-09-12 16:05
471 查看
访问php文件,不能解析或直接下载,nginx.conf中如下配置不正确或未配置
userwwwwww;
index index.phpindex.htmlindex.htm;
#
pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000
#
#取消FastCGI
server部分location的注释,注意fastcgi_param行的参数,改为$document_root$fastcgi_script_name,或者使用绝对路径
location~\.php${
roothtml;
fastcgi_pass127.0.0.1:9000;
fastcgi_indexindex.php;
fastcgi_paramSCRIPT_FILENAME$document_root$fastcgi_script_name;
includefastcgi_params;
}
访问php文件,nginx对PHP文件报File not found 错误
错误原因:配置文件 nginx.conf 中
userwwwwww;
index index.phpindex.htmlindex.htm;
#
pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000
#
#取消FastCGI
server部分location的注释,注意fastcgi_param行的参数,改为$document_root$fastcgi_script_name,或者使用绝对路径
location~\.php${
roothtml;
fastcgi_pass127.0.0.1:9000;
fastcgi_indexindex.php;
fastcgi_paramSCRIPT_FILENAME$document_root$fastcgi_script_name;
includefastcgi_params;
}
fastcgi_param SCRIPT_FILENAME /scripts$fastcgi_script_name;
改成如下这句,即可
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
userwwwwww;
index index.phpindex.htmlindex.htm;
#
pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000
#
#取消FastCGI
server部分location的注释,注意fastcgi_param行的参数,改为$document_root$fastcgi_script_name,或者使用绝对路径
location~\.php${
roothtml;
fastcgi_pass127.0.0.1:9000;
fastcgi_indexindex.php;
fastcgi_paramSCRIPT_FILENAME$document_root$fastcgi_script_name;
includefastcgi_params;
}
访问php文件,nginx对PHP文件报File not found 错误
错误原因:配置文件 nginx.conf 中
userwwwwww;
index index.phpindex.htmlindex.htm;
#
pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000
#
#取消FastCGI
server部分location的注释,注意fastcgi_param行的参数,改为$document_root$fastcgi_script_name,或者使用绝对路径
location~\.php${
roothtml;
fastcgi_pass127.0.0.1:9000;
fastcgi_indexindex.php;
fastcgi_paramSCRIPT_FILENAME$document_root$fastcgi_script_name;
includefastcgi_params;
}
fastcgi_param SCRIPT_FILENAME /scripts$fastcgi_script_name;
改成如下这句,即可
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
相关文章推荐
- centos 启动出现 UNEXPECTED INCONSISTENCY RUN fsck MANUALLY
- Linux 学习:find命令习题
- linux下如何挂载光驱
- “TI门外汉”的觉醒~~
- Linux 学习:文件查找的使用
- VMWare下linux安装及中文语言包安装详细步骤
- Centos 6.x/7.x yum安装php5.6.X(最新版)
- 鸟哥的Linux私房菜5.1部分笔记:linux注销、x window与命令行模式的切换(新手接触linux)
- linux常用命令-关机重启
- linux内核中断之看门狗
- Linux内核笔记——内存管理之块内存分配
- Linux 系统安全 及 lnmp 安装
- linux 学习笔记之权限管理命令
- linux学习笔记之文件搜索命令
- linux 学习笔记之文件的压缩和解压
- linux 学习之帮助命名
- 个人学习笔记---linux原子操作的实现原理
- Linux下彻底卸载mysql数据库
- centos安装git客户端以及常用指令
- 使用iptables配置linux服务器请求转发