Nginx配置phpmyadmin流程以下:php
sudo LC_ALL=C.UTF-8 add-apt-repository ppa:ondrej/php sudo apt-get update sudo apt-get install php-pear php7.1-cli php7.1-common php7.1-curl \ php7.1-dev php7.1-fpm php7.1-json php7.1-mbstring php7.1-mcrypt \ php7.1-mysql php7.1-opcache php7.1-zip php7.1-intl php7.1-gd php7.1-xml
sudo sed -i 's/listen = .*/listen = 127.0.0.1:9000/g' /etc/php/7.1/fpm/pool.d/www.conf
sudo service php7.1-fpm restart
# 可在 http://dev.mysql.com/downloads/repo/apt/ 頁面找到 mysql-apt-config 的最新版本。 wget http://dev.mysql.com/get/mysql-apt-config_0.8.7-1_all.deb sudo dpkg -i mysql-apt-config_0.8.7-1_all.deb
這時會彈出讓你選擇,將:mysql
MySQL Server修改成: mysql-5.7
MySQL Tools & Connectors (Currently selected: Enabled)修改成Disabled。
MySQL Preview Packages修改過爲 Disabled。nginx
sudo apt-get update sudo apt-get install mysql-server
wget https://files.phpmyadmin.net/phpMyAdmin/4.8.5/phpMyAdmin-4.8.5-all-languages.zip unzip phpMyAdmin-4.8.5-all-languages.zip mv phpMyAdmin-4.8.5-all-languages.zip phpmyadmin
sudo add-apt-repository ppa:nginx/stable sudo apt-get update sudo apt-get install nginx
cp -r phpmyadmin /var/www
這段代碼放到http{}裏面sql
server { listen 8090; root /var/www/phpmyadmin; index index.php; location ~ \.php$ { include snippets/fastcgi-php.conf; fastcgi_pass unix:/run/php/php7.1-fpm.sock; }
4、重啓nginxjson
訪問:http://IP地址:8090/便可看到
效果圖以下:ubuntu