ubuntu16安装nginx+phpmyadmin

前端之家收集整理的这篇文章主要介绍了ubuntu16安装nginx+phpmyadmin前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。

环境: ubuntu16,PHP7,Nginx 1.10.3

安装MysqL
sudo apt install MysqL-server MysqL-client libMysqLclient-dev
安装Nginx
sudo apt install Nginx
安装PHP
sudo apt install PHP PHP-MysqL PHP-fpm
下载PHPmyadmin
cd /var/www
sudo wget https://files.PHPmyadmin.net/PHPMyAdmin/4.7.7/PHPMyAdmin-4.7.7-all-languages.zip
unzip PHPMyAdmin-4.7.7-all-languages.zip
mv PHPMyAdmin-4.7.7-all-languages PHPmyadmin

修改Nginx配置
sudo nano /etc/Nginx/site-enabled/PHPmyadmin
复制以下内容(注意PHP7.0-fpm.sock版本号要改成PHP的版本)

server {
 listen 8100;
 root /var/www/PHPmyadmin;
 index index.PHP;

 location ~ \.PHP$ {
   include snippets/fastcgi-PHP.conf;
   fastcgi_pass unix:/run/PHP/PHP7.0-fpm.sock;
 }
}

重启Nginx
sudo service Nginx restart

访问http://127.0.0.1:8100使用

猜你在找的Ubuntu相关文章