Merge pull request #40 from Strobotti/vagrant

Fix vagrant provisioning
pull/41/head
Franz Liedke 2017-03-03 08:53:29 +01:00 committed by GitHub
commit ba53bc77fd
2 changed files with 23 additions and 5 deletions

6
Vagrantfile vendored
View File

@ -36,7 +36,7 @@ mongo_enable_remote = "false" # remote access enabled when true
# Languages and Packages # Languages and Packages
php_timezone = "UTC" # http://php.net/manual/en/timezones.php php_timezone = "UTC" # http://php.net/manual/en/timezones.php
php_version = "5.6" # Options: 5.5 | 5.6 php_version = "7.1" # Options: 5.6 | 7.0 | 7.1
ruby_version = "latest" # Choose what ruby version should be installed (will also be the default version) ruby_version = "latest" # Choose what ruby version should be installed (will also be the default version)
ruby_gems = [ # List any Ruby Gems that you want to install ruby_gems = [ # List any Ruby Gems that you want to install
#"jekyll", #"jekyll",
@ -175,7 +175,7 @@ Vagrant.configure("2") do |config|
config.vm.provision "shell", path: "#{github_url}/scripts/base_box_optimizations.sh", privileged: true config.vm.provision "shell", path: "#{github_url}/scripts/base_box_optimizations.sh", privileged: true
# Provision PHP # Provision PHP
config.vm.provision "shell", path: "#{github_url}/scripts/php.sh", args: [php_timezone, hhvm, php_version] config.vm.provision 'shell', inline: "sudo add-apt-repository -y ppa:ondrej/php && sudo apt-get update && sudo apt-get -y install php#{php_version}-fpm php#{php_version}-curl php#{php_version}-mbstring php#{php_version}-xml php#{php_version}-mysql php#{php_version}-gd", run: "once"
# Enable MSSQL for PHP # Enable MSSQL for PHP
# config.vm.provision "shell", path: "#{github_url}/scripts/mssql.sh" # config.vm.provision "shell", path: "#{github_url}/scripts/mssql.sh"
@ -317,6 +317,6 @@ Vagrant.configure("2") do |config|
# Any local scripts you may want to run post-provisioning. # Any local scripts you may want to run post-provisioning.
# Add these to the same directory as the Vagrantfile. # Add these to the same directory as the Vagrantfile.
########## ##########
config.vm.provision "shell", path: "./scripts/environment.sh", privileged: false config.vm.provision "shell", inline: "/bin/bash /vagrant/scripts/environment.sh --php-version #{php_version}", run: "once"
end end

View File

@ -1,5 +1,23 @@
#! /bin/bash #! /bin/bash
# Defaults:
PHP_VERSION=5.6
while [[ $# -gt 1 ]]; do
key="$1"
case "$key" in
--php-version)
PHP_VERSION="$2"
shift # past argument
;;
*)
# unknown option
;;
esac
shift # past argument or value
done
block=" block="
server { server {
listen 80; listen 80;
@ -36,8 +54,8 @@ block="
location ~ \.php$ { location ~ \.php$ {
try_files \$uri =404; try_files \$uri =404;
fastcgi_split_path_info ^(.+\.php)(/.+)$; fastcgi_split_path_info ^(.+\.php)(/.+)$;
# With php5-fpm: # With php-fpm:
fastcgi_pass 127.0.0.1:9000; fastcgi_pass unix:/run/php/php${PHP_VERSION}-fpm.sock;
fastcgi_index index.php; fastcgi_index index.php;
include fastcgi_params; include fastcgi_params;
fastcgi_param SCRIPT_FILENAME \$document_root\$fastcgi_script_name; fastcgi_param SCRIPT_FILENAME \$document_root\$fastcgi_script_name;