CentOS php7 nginx

sudo yum  install epel-release
sudo rpm -Uvh https://mirror.webtatic.com/yum/el7/webtatic-release.rpm
sudo yum install php72w php72w-fpm php72w-cli php72w-common php72w-devel php72w-gd php72w-pdo php72w-mysql php72w-mbstring php72w-bcmath



location / {
        # Redirect everything that isn't a real file to index.php
        try_files $uri $uri/ /index.php?_url=$uri&$args;
}


location ~ /\.ht {
      deny all;
}

location ~ \.php$ {
        root /var/www/html; #指定php的根目录
        fastcgi_pass 127.0.0.1:9000;#php-fpm的默认端口是9000
        fastcgi_index index.php;
        fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
        include fastcgi_params;
}

 

你可能感兴趣的:(WEB开发,进阶)