首先安裝 Nginx
apt install nginx
安裝 PHP 7.4 相關常用函式庫(依個人需求可增刪)
apt install php7.4-fpm php7.4-mysql php7.4-curl php7.4-gd php7.4-intl php-pear php-imagick php7.4-imap php-memcache php7.4-pspell php7.4-sqlite3 php7.4-tidy php7.4-xmlrpc php7.4-xsl php7.4-mbstring php7.4-bcmath php7.4-gmp
安裝 PHP APCU
apt install php-apcu
接著重啟 PHP7.4 FPM
/etc/init.d/php7.4-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.4-fpm.sock; } [...]
修改 index
index index.php index.html index.htm index.nginx-debian.html;
之後重啟 Nginx
/etc/init.d/nginx restart