I’ve been away from PHP nearly four years, I’ve been working in javascript and Node.JS instead. I have a memory of what tools I was comfortable working with… it’s a rusty memory how it all went together. I’ve followed Vagrant Crash Course
and have connected from MySQL WorkBench.
I’d like to use PHPAdmin, Do I need to add it to the bootstrap file or is it an external connection like the workbench?
bootstrap.sh
# Update Packages
apt-get update
# Upgrade Packages
apt-get upgrade
# Basic Linux Stuff
apt-get install -y git
# Apache
apt-get install -y apache2
# Enable Apache Mods
a2enmod rewrite
#Add Onrej PPA Repo
apt-add-repository ppa:ondrej/php
apt-get update
# Install PHP
apt-get install -y php7.2
# PHP Apache Mod
apt-get install -y libapache2-mod-php7.2
# Restart Apache
service apache2 restart
# PHP Mods
apt-get install -y php7.2-common
apt-get install -y php7.2-mcrypt
apt-get install -y php7.2-zip
# Set MySQL Pass
debconf-set-selections <<< 'mysql-server mysql-server/root_password password root'
debconf-set-selections <<< 'mysql-server mysql-server/root_password_again password root'
# Install MySQL
apt-get install -y mysql-server
# PHP-MYSQL lib
apt-get install -y php7.2-mysql
# Restart Apache
sudo service apache2 restart
Vagrantfile
# -*- mode: ruby -*-
# vi: set ft=ruby :
Vagrant.configure("2") do |config|
# Box Settings
config.vm.box = "ubuntu/trusty64"
# Provider Settings
config.vm.provider "virtualbox" do |vb|
# vb.memory = 2048
# vb.cpus = 4
end
# Network Settings
# config.vm.network "forwarded_port", guest: 80, host: 8080
# config.vm.network "forwarded_port", guest: 80, host: 8080, host_ip: "127.0.0.1"
config.vm.network "private_network", ip: "192.168.33.10"
# Folder Settings
config.vm.synced_folder ".", "/var/www/html", :nfs => { :mount_options => ["dmode=777", "fmode=666"] }
config.vm.provision "shell", path: "bootstrap.sh"
end