based on CentOS7

yum install epel-release
rpm -Uvh http://rpms.famillecollet.com/enterprise/remi-release-7.rpm
rpm -Uvh http://repo.mysql.com/mysql-community-release-el7-5.noarch.rpm
yum --enablerepo=remi-php72 install php
yum --enablerepo=remi-php72 search php
yum --enablerepo=remi-php72 install php-mysql php-xml \
php-soap php-xmlrpc php-mbstring php-json php-gd php-mcrypt
yum install nginx
systemctl enable nginx.service
systemctl start nginx.service
yum --enablerepo=remi-php72 install php-fpm

vim nginx.conf
    server {
        listen       80 ;
        listen       [::]:80 ;
        server_name  sql.example.com;
        root         /usr/share/phpMyAdmin/;
        index index.php index.html index.htm;
        # Load configuration files for the default server block.
        include /etc/nginx/default.d/*.conf;

        location / {
        }

        error_page 404 /404.html;
        location = /404.html {
        }

        error_page 500 502 503 504 /50x.html;
        location = /50x.html {
        }

        location ~ .php$ {
                try_files $uri =404;
                fastcgi_pass 127.0.0.1:9000;
                fastcgi_index index.php;
                fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
                include fastcgi_params;
        }
}

systemctl restart nginx.service
systemctl enbale nginx.service
systemctl restart php-fpm.service
systemctl enable php-fpm.service

Comments powered by CComment