PHP Dependency of phpMyadmin & WordPress

前置作業 – Nginx & PHP & MySQL

關於 MySQL 8 的安裝請參考這篇 – Ubuntu 安裝 MySQL 8.0 (mysql-community-server)

nginx 跟 php 是用 Ondřej Surý 打包好的。

sudo add-apt-repository -n ppa:ondrej/php && sudo add-apt-repository -n ppa:ondrej/nginx-mainline

MySQL 的部份看要使用 MySQLMariaDB 或是 PERCONA 都可以。

PHP7.4

sudo apt install dbconfig-common dbconfig-mysql javascript-common libapr1 libaprutil1 libaprutil1-dbd-sqlite3 libaprutil1-ldap libcurl4 libflac8 libjs-cropper libjs-jquery libjs-sphinxdoc libjs-underscore liblua5.2-0 libnghttp2-14 libpcre2-8-0 libphp-phpmailer libpsl5 librtmp1 libsodium23 libzip4 php php-bz2 php-common php-curl php-gd php-getid3 php-mbstring php-mysql php-pear php-phpseclib php-tcpdf php-xml php-zip php7.4 php7.4-bz2 php7.4-cli php7.4-common php7.4-curl php7.4-fpm php7.4-gd php7.4-fpm php7.4-json php7.4-mbstring php7.4-mysql php7.4-opcache php7.4-readline php7.4-xml php7.4-zip publicsuffix vorbis-tools

PHP8.0(把上面 7.4 都換成 8.0,沒有的直接去掉 7.4)

sudo apt install php-getid3 php8.0 php8.0-bz2 php8.0-cli php8.0-common php8.0-curl php8.0-fpm php8.0-gd php8.0-fpm php8.0-mbstring php8.0-mysql php8.0-opcache php8.0-readline php8.0-xml php8.0-zip

phpMyAdmin 前製作業

sudo mysql_secure_installation

跑完之後,設定 phpmyadmin 帳號權限

sudo mysql -u root -p
GRANT ALL PRIVILEGES ON *.* TO 'phpmyadmin'@'localhost' WITH GRANT OPTION;
FLUSH PRIVILEGES;

設定 nginx

安裝 WordPress