• linux安装php7.4和nginx并安装配置wordpress


    一、安装php

    centos7系统下使用yum安装php7.4正式版,当前基于WLNMP提供的一键安装包来安装

    1、添加epel源

    1、配置nginx

    • 如果使用WLNMP提供的nginx,只需要在安装后取消include enable-php71.conf;注释即可

    WLNMP安装nginx方法

    • 如果当前使用的是非WLNMP提供的nginx,只需要在nginx中配置以下内容即可
    location ~ [^/]\.php(/|$)
            {
                try_files $uri =404;
                fastcgi_pass  unix:/tmp/php-fpm74.sock;
                fastcgi_index index.php;
                include fastcgi.conf;
            }

    三、安装wordpress

    去官网下载最新的wordpress包并解压上传到ng配置的站点根目录即可,安装好后访问wordpress文章可能会出现“File note found”,

    五、ng配置

    # wordpress ng 配置
        server {
            listen       80;
            server_name  ww.xxx.com;
            root  /usr/local/xxxx;
            location / {
                root /usr/local/xxxx;
                index  index.html index.htm index.php;
                try_files $uri $uri/ /index.php?q=$uri&$args; 
            } 
    
            # PHP 脚本请求全部转发到 FastCGI处理. 使用FastCGI协议默认配置.
            # Fastcgi服务器和程序(PHP,Python)沟通的协议.
            location ~ \.php$ {
                # 设置脚本文件请求的路径
                fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
                # 设置监听端口
                fastcgi_pass localhost:9000;
                # fastcgi_pass unix:/run/php-fpm/www.sock;
                # 设置nginx的默认首页文件(上面已经设置过了,可以删除)
                fastcgi_index index.php;
                # 引入fastcgi的配置文件
                include fastcgi_params;
            }
        }
  • 相关阅读:
    ReSharper Tips—GotoImplementation
    Possible multiple enumeration of IEnumerable
    Hello, Razor!
    自话自说——POI使用需要注意一个地方
    css中怎么设置透明度的问题
    记录排查国标直播流播放卡顿的问题
    互联网上做广告的优点
    C#、.Net经典面试题集锦(一)
    什么是MFC
    C/S与B/S 的区别
  • 原文地址:https://www.cnblogs.com/shamo89/p/16416904.html
Copyright © 2020-2023  润新知