标签归档:webtatic

centos 7 + php 7 + nginx + wordpress之yum最简单安装办法

安装eple库

rpm -Uvh https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm

安装webtatic库

rpm -Uvh https://mirror.webtatic.com/yum/el7/webtatic-release.rpm

更新yum源

yum update

安装php7以及扩展

yum install php71w-gd php71w-pdo php71w-opcache php71w-fpm php71w-pecl-redis php71w-mysql php71w-mcrypt php71w-mbstring php71w-intl php71w-cli

安装nginx

yum install nginx1w -y

系统启动时自动启动nginx以及php-fpm

systemctl enable nginx php-fpm
systemctl start nginx php-fpm

修改php程序目录权限

chown -R apache:apache /data/web/www.c4ys.com/

修改ngingx配置(以为wordpress例)

vim /etc/nginx/conf.d/www.c4ys.com.conf

server {
    server_name  www.c4ys.com c4ys.com;
    root   /data/phpproject/www.c4ys.com;
    location / {
        index  index.html index.php;
        try_files $uri $uri/ /index.php?$args;
    }
    location ~ \.php$ {
        fastcgi_pass   127.0.0.1:9000;
        include        fastcgi_params;
        fastcgi_param  SCRIPT_FILENAME $document_root$fastcgi_script_name;
    }
}