Skip to content

Instantly share code, notes, and snippets.

@gelanivishal
Last active February 21, 2017 01:39
Show Gist options
  • Save gelanivishal/d06c67d3ce86e09f23d4045bb33f15f1 to your computer and use it in GitHub Desktop.
Save gelanivishal/d06c67d3ce86e09f23d4045bb33f15f1 to your computer and use it in GitHub Desktop.
Ubuntu 16.04: Install Nginx + PHP7 + MySql
# Nginx
sudo apt-get update
sudo apt-get install nginx
sudo nano /etc/nginx/sites-available/default
# PHP
sudo apt-get update
sudo apt-get install php7.0-fpm php-mysql
sudo apt-get install php7.0-mysql php7.0-mysqli php7.0-curl php7.0-json php7.0-mcrypt php7.0-zip php7.0-dom php7.0-intl
sudo nano /etc/php/7.0/fpm/php.ini
sudo nano /etc/php/7.0/fpm/pool.d/www.conf
listen = /run/php/php7.0-fpm.sock
# MySQL
sudo apt-get install mysql-server
# phpMyAdmin
sudo apt-get install phpmyadmin
# In step one, do not select any server configuration, you can just hit TAB
# http://tecadmin.net/install-php-7-nginx-mysql-on-ubuntu/
# 1. sudo apt-get install phpmyadmin
# 2. add following configuration at /etc/nginx/default.d/phpmyadmin.conf
location /phpmyadmin {
root /usr/share/;
index index.php index.html index.htm;
location ~ ^/phpMyAdmin/(.+\.php)$ {
try_files $uri =404;
root /usr/share/;
fastcgi_pass unix:/run/php/php7.0-fpm.sock;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
}
location ~* ^/phpmyadmin/(.+\.(jpg|jpeg|gif|css|png|js|ico|html|xml|txt))$ {
root /usr/share/;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment