mysql_nginx_php7.0 on ubuntu 16.04

今天在一台30M的阿里云香港轻应用服务器上分别测试了一下php7.0和php7.2下运行wordpress的测试,结果是在php7.2下运行wordpress 4.x会报以下错误:
PHP Fatal error: Uncaught Error: [] operator not supported

在php7.0下运行wordpress 4.x是正常的,由于时间有限没时间去解决php7.2下的问题了,只能重新DD回纯净的系统,直接安装php7.0版本的,以下是mysql+nginx+php步骤:

1
2
3
4
5
6
7
sudo apt-get install mysql-server
sudo mysql_secure_installation
sudo apt-get install -y software-properties-common
sudo add-apt-repository ppa:nginx/stable
sudo apt-get update
sudo apt-get install -y nginx
sudo apt-get install php-cli php-fpm php-curl php-gd php-mysql php-mbstring zip unzip

vi /etc/php/7.0/fpm/php.ini

1
cgi.fix_pathinfo=0

vi /etc/nginx/sites-available/default

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
server {
        listen 80 default_server;
        listen [::]:80 default_server;
        root /var/html/www.itkylin.com;
        index index.html index.htm index.nginx-debian.html;
 
        server_name www.itkylin.com;
 
        location / {
                try_files $uri $uri/ =404;
        }
        location ~ \.php$ {
                include snippets/fastcgi-php.conf;
                fastcgi_pass unix:/run/php/php7.0-fpm.sock;
        }
        location ~ /\.ht {
                deny all;
        }
}

systemctl restart php7.0-fpm
systemctl restart nginx