centos php-fpm nginx配置

移除旧的软件包:yum remove httpd* php*
安装:yum install php php-fpm
yum install php-gd php-mysql php-mbstring php-xml php-mcrypt
验证配置文件:
/etc/init.d/nginx configtest
重启:
 /etc/init.d/nginx restart
 /etc/init.d/php-fpm restart  

出现这个错误可能是路径写错了:
Access denied.
nginx php-fpm 访问.php文件出现Access denied

也可能是权限,改为nginx:
vi /etc/php-fpm.d/www.conf 

; Unix user/group of processes
; Note: The user is mandatory. If the group is not set, the default user‘s group
;       will be used.
; RPM: apache Choosed to be able to access some dir as httpd
user = nginx
; RPM: Keep a group allowed to write in log dir.
group = nginx 

nginx节点配置示例:
server {
    listen       80;
    server_name  domain;
        root    /wwwdir;

    location / {
        index  index.html index.htm index.php;
    }

    #
    location ~ \.php$ {
        include fastcgi_params;
                fastcgi_pass  127.0.0.1:9000;
                fastcgi_index index.php;
                fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
    }

}

  

时间: 2024-08-01 08:45:48

centos php-fpm nginx配置的相关文章

CentOS 7 安装 Nginx 配置反向代理

Linux使用Nginx Yum存储库上安装Nginx,适用于Red Hat Enterprise Linux和CentOS系统. 1.添加设置Nginx Yum存储库 在CentOS中首次安装Nginx时,需要添加Nginx软件包,使用以下命名,添加安装 sudo yum install yum-utils 设置Yum存储库,请创建/etc/yum.repos.d/nginx.repo配置文件,配置内容如下 [nginx-stable] name=nginx stable repo baseu

【CentOS 7】nginx配置web服务器

1,安装过程 [[email protected]_1_14_centos ~]# cd /data/ [[email protected]_1_14_centos data]# wget http://nginx.org/download/nginx-1.15.7.tar.gz [[email protected]_1_14_centos data]# tar -xvf nginx-1.15.7.tar.gz [[email protected]_1_14_centos data]# mkdi

一些NGINX配置

一些nginx配置 使用独立目录, 然后include具体配置 gzip on for multi processers static file cache proxy pass 静态目录 or 文件 静态站 return for mobile redirect to www allow and deny 负载均衡 centos service cmds nginx配置 开年第一篇, 梳理笔记本中.... 没啥, 一些用到以及后面可能用到的nginx配置, 记录一下, 备查备用 ps. 之前一篇

LNMP搭建(CentOS 6.3+Nginx 1.2.0+PHP 5.3.15(fpm)+ MySQL 5.5.35)

Nginx ("engine x") 是一个高性能的 HTTP 和反向代理服务器,也是一个 IMAP/POP3/SMTP 代理服务器. Nginx 是由 Igor Sysoev 为俄罗斯访问量第二的 Rambler.ru 站点开发的,它已经在该站点运行超过三年了.Igor 将源代码以类BSD许可证的形式发布. 系统环境: # cat /etc/redhat-release CentOS release 6.3 (Final) 1.安装所需的第三方库 yum -y install gcc

CentOS 6.5安装配置LNMP服务器(Nginx+PHP+MySQL)

CentOS 6.5安装配置LNMP服务器(Nginx+PHP+MySQL) 一.准备篇: 1 /etc/init.d/iptables stop #关闭防火墙 2 关闭SELINUX 3 vi /etc/selinux/config 4 #SELINUX=enforcing #注释掉 5 #SELINUXTYPE=targeted #注释掉 6 SELINUX=disabled #增加 7 :wq 8 shutdown -r now #重启系统 二.安装篇 1.安装nginx 1 yum re

为微信小程序开发做准备,在Centos 6.8下利用letsencrypt.sh脚本为nginx 配置免费https证书

原文链接: http://phpecshop.blog.51cto.com/6296699/1891737 最近在做微信小程序商城开发的时候,阅读官方api文档发现要求https,的路程. wx.request(OBJECT) wx.request发起的是 HTTPS 请求. 于是开始了在Centos 6.8下利用letsencrypt.sh脚本为nginx 配置免费https(Let's Encrypt SSL证书) 1.下载letsencrypt.sh # wget https://raw.

CentOS 6.6 nginx PHP 配置

/************************************************************************* * CentOS 6.6 nginx PHP 配置 * 说明: * 在VPS上安装nginx PHP配置,以供有些时候无聊使用. * * 2016-11-26 深圳 南山平山村 曾剑锋 ************************************************************************/ 一.参考文档:

图文:CentOS 下对 Nginx + Tomcat 配置 SSL 实现服务器 / 客户端双向认证

1. 安装 nginx 1.1 nginx 包及其依赖包下载 出于模块的依赖性,Nginx 依赖以下三个包: gzip 模块需要 zlib 库(http://www.zlib.net/): rewrite 模块需要 pcre 库(http://www.pcre.org/): ssl 功能需要 openssl 库(http://www.openssl.org/): 分别下载它们的最新稳定版(截至本文最新稳定版分别是 zlib-1.2.8.tar.gz.pcre-8.36.tar.gz.openss

CentOS 6.4安装配置LNMP服务器(Nginx+PHP+MySQL)

这篇文章主要介绍了CentOS 6.4下配置LNMP服务器的详细步骤,需要的朋友可以参考下 准备篇 1.配置防火墙,开启80端口.3306端口vi /etc/sysconfig/iptables-A INPUT -m state --state NEW -m tcp -p tcp --dport 80 -j ACCEPT #允许80端口通过防火墙-A INPUT -m state --state NEW -m tcp -p tcp --dport 3306 -j ACCEPT #允许3306端口

CentOS 6.7下配置 yum 安装 Nginx

CentOS 6.7下配置 yum 安装 Nginx. 转载:http://www.linuxidc.com/Linux/2016-07/133283.htm 第一步,在/etc/yum.repos.d/目录下创建一个源配置文件nginx.repo: cd /etc/yum.repos.d/ vim nginx.repo 填写如下内容: [nginx]name=nginx repobaseurl=http://nginx.org/packages/centos/6/$basearch/gpgch