Skip to content

Instantly share code, notes, and snippets.

@maksimize
Last active January 9, 2017 23:04
Show Gist options
  • Save maksimize/8d206e0ad5a3f2e98b6d to your computer and use it in GitHub Desktop.
Save maksimize/8d206e0ad5a3f2e98b6d to your computer and use it in GitHub Desktop.
PHP7
#!/bin/bash
#sudo chmod +x install.sh
#install essential apps
sudo apt-get update
sudo apt-get upgrade
sudo apt-get --assume-yes install git curl nginx
#install php7
sudo add-apt-repository ppa:ondrej/php
sudo apt-get update
sudo apt-get install php7.0 php7.0-fpm php7.0-mysql php7.0-curl php7.0-mcrypt php7.0-mbstring php7.0-xml
#/etc/nginx/sites-enabled/default
server {
listen 80 default_server;
listen [::]:80 default_server ipv6only=on;
root /home/ubuntu/laravel/public/;
index index.php index.html index.htm;
server_name localhost;
location / {
try_files $uri $uri/ /index.php?$query_string;
}
location ~ \.php$ {
try_files $uri =404;
fastcgi_split_path_info ^(.+\.php)(/.+)$;
#fastcgi_pass unix:/var/run/php/php7.0-fpm.sock;
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment