PHP7.2在CENTOS7.4上源码安装+NGINX配置WORDPRESS 80转使用443端口

1、yum install libjpeg libjpeg-devel libpng libpng-devel freetype freetype-devel libxml2 libxml2-devel libxslt-devel pcre-devel bison-devel

2、./configure –prefix=/opt/php –with-freetype-dir –with-gd –with-gettext –with-iconv-dir –with-libdir=lib64 –with-libxml-dir –with-mysqli –with-openssl –with-pcre-regex –with-pdo-mysql –with-pear –with-png-dir –with-xmlrpc –with-xsl –with-zlib –enable-fpm –enable-bcmath –enable-libxml –enable-inline-optimization –enable-mbregex –enable-mbstring –enable-opcache –enable-pcntl –enable-shmop –enable-soap –enable-sockets –enable-sysvsem –enable-xml –enable-zip –with-libzip

3、

user  nobody;
worker_processes  4;
error_log  logs/error.log;
pid        logs/nginx.pid;
events {
    worker_connections  60240;
}
http {
    include       mime.types;
    default_type  application/octet-stream;
    log_format  main  '$remote_addr - $remote_user [$time_local] "$request" '
                      '$status $body_bytes_sent "$http_referer" '
                      '"$http_user_agent" "$http_x_forwarded_for"';
    access_log  logs/access.log  main;
    sendfile        on;
    tcp_nopush     on;
    keepalive_timeout  65;
    gzip  on;
    server {
        listen       80;
        server_name  localhost;
        return       https://blog.yayaw.com$request_uri;
    }
    server {
        listen       443;
        server_name  blog.yayaw.com;
        charset utf-8;
        ssl          on;
        ssl_certificate   cert/214392944180605.pem;
        ssl_certificate_key  cert/214392944180605.key;
        ssl_session_timeout 5m;
        ssl_ciphers ECDHE-RSA-AES128-GCM-SHA256:ECDHE:ECDH:AES:HIGH:!NULL:!aNULL:!MD5:!ADH:!RC4;
        ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
        ssl_prefer_server_ciphers on;
        location / {
            root   html;
            index  index.php;
            try_files $uri $uri/ /index.php?$args;
        }
        location ~ \.php$ {
            root           html;
            fastcgi_pass   127.0.0.1:9000;
            fastcgi_index  index.php;
            fastcgi_param  SCRIPT_FILENAME  $document_root$fastcgi_script_name;
            include        fastcgi_params;
        }
    }
}