Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
A quick-and-simple VM with PHP 7.2
# -*- mode: ruby -*-
# vi: set ft=ruby :
Vagrant.configure("2") do |config|
config.vm.box = "debian/jessie64"
config.vm.host_name = "phpvm"
config.vm.box_check_update = false
config.vm.network "private_network", ip: "192.168.33.67"
config.vm.provider "virtualbox" do |vb|
vb.memory = "1024"
end
config.vm.provision "shell", inline: <<-SHELL
apt install -y apt-transport-https \
lsb-release \
ca-certificates
# Get the new repositories
echo "deb https://packages.sury.org/php/ jessie main" >> /etc/apt/sources.list.d/php.list
echo "deb-src https://packages.sury.org/php/ jessie main" >> /etc/apt/sources.list.d/php.list
# Add DotDeb GPG key to apt
wget -O /etc/apt/trusted.gpg.d/php.gpg https://packages.sury.org/php/apt.gpg
sudo apt-key add /etc/apt/trusted.gpg.d/php.gpg
# Time to install
apt-get update
apt-get install -y apache2 \
curl \
libapache2-mod-php7.2 \
php7.2 \
php7.2-bcmath \
php7.2-bz2 \
php7.2-cgi \
php7.2-cli \
php7.2-common \
php7.2-curl \
php7.2-dba \
php7.2-dev \
php7.2-enchant \
php7.2-fpm \
php7.2-gd \
php7.2-gmp \
php7.2-imap \
php7.2-interbase \
php7.2-intl \
php7.2-json \
php7.2-ldap \
php7.2-mbstring \
php7.2-mysql \
php7.2-odbc \
php7.2-opcache \
php7.2-pgsql \
php7.2-phpdbg \
php7.2-pspell \
php7.2-readline \
php7.2-recode \
php7.2-snmp \
php7.2-soap \
php7.2-sodium \
php7.2-sqlite3 \
php7.2-sybase \
php7.2-tidy \
php7.2-xml \
php7.2-xmlrpc \
php7.2-xsl \
php7.2-zip
echo "[global]" > /etc/freetds/freetds.conf
echo " tds version = 8.0" >> /etc/freetds/freetds.conf
echo " text size = 20971520" >> /etc/freetds/freetds.conf
echo " client charset = UTF-8" >> /etc/freetds/freetds.conf
echo " dump file = /tmp/freetds.log" >> /etc/freetds/freetds.conf
SHELL
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.