Skip to content

Instantly share code, notes, and snippets.

@noppolp
Last active August 29, 2015 14:11
Show Gist options
  • Save noppolp/d50c9a5fd6d181481d04 to your computer and use it in GitHub Desktop.
Save noppolp/d50c9a5fd6d181481d04 to your computer and use it in GitHub Desktop.
Install PHP on nginx
### PhpMyAdmin (by different root)
$ sudo apt-get install php5-mysql phpmyadmin
$ sudo apt-get install php5-fpm
$ sudo nano /etc/nginx/sites-available/default
location /phpmyadmin {
root /usr/share/;
index index.php index.html index.htm;
}
location ~ ^/phpmyadmin/(.+\.php)$ {
root /usr/share/;
try_files $uri =404;
fastcgi_pass unix:/var/run/php5-fpm.sock;
fastcgi_index index.php;
include fastcgi_params;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
}
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