Ubuntu 16.04 + Nginx + PHP 7.0 + Mariadb

首先安裝 Nginx

apt install nginx

接著安裝 PHP 7.0 FPM

apt install php7.0-fpm

安裝 PHP 7.0 相關常用函式庫(依個人需求可增刪)

apt install php7.0-mysql php7.0-curl php7.0-gd php7.0-intl php-pear php-imagick php7.0-imap php7.0-mcrypt php-memcache  php7.0-pspell php7.0-recode php7.0-sqlite3 php7.0-tidy php7.0-xmlrpc php7.0-xsl php7.0-mbstring php-gettext

安裝 PHP APCU

apt install php-apcu

接著重啟 PHP7.0 FPM

/etc/init.d/php7.0-fpm restart

修改 Nginx /etc/nginx/sites-available/default

vi /etc/nginx/sites-available/default

加入 PHP 執行

[...]
  location ~ \.php$ {
    include snippets/fastcgi-php.conf;
    fastcgi_pass unix:/run/php/php7.0-fpm.sock;
  }
[...]

修改 index

index index.php index.html index.htm index.nginx-debian.html;

之後重啟 Nginx

/etc/init.d/nginx restart

 

Leave a Reply

發佈留言