Loading...
 
Scotch Box is a pre-configured Vagrant Box with a full array of features to get you up and running with Vagrant in no time.

Scotch Box

Scotch Box is a pre-configured Vagrant Box with a full array of features to get you up and running with Vagrant in no time.

References

Quick Generic PHP Project Set Up

#!/bin/bash

# Create a root directory
mkdir myproject
cd myproject

# Initialize the Git Repo
git init

# Local Git Config, useful if you are working on multiple projects, say personal and work
git config --local user.name "Michael Alber"
git config --local user.email michael.k.alber@gmail.com

# PHPStorm .gitignore
gi linux,jetbrains,vagrant,macos,windows >> .gitignore

# ScotchBox 
wget -O Vagrantfile https://raw.githubusercontent.com/scotch-io/scotch-box/master/Vagrantfile

# Basic Directories 
mkdir -p htdocs/public/{css,js,img}
mkdir -p htdocs/logs
mkdir -p htdocs/src
mkdir -p htdocs/tests

# Create initial index.php and index.php files
cd htdocs/public
echo -e "<php\necho 'Hello, World';\n?>" > index.php
echo -e "<php\necho phpinfo();\n?>" > info.php

# Commit to the Git Repo
git add .
git commit -m'Initial PHP project'

# To Do - Update the shared path in Vagrantfile to point to th new htdocs directory
# config.vm.synced_folder "./htdocs", "/var/www", :mount_options => ["dmode=777", "fmode=666"]

# To Do - Start the Vagrant VM
# vagrant up

# To Do - Open http://192.168.33.10 via your favorite browser and you should see "Hello, World"

# To Do - Open http://192.168.33.10/info.php to check / view PHP's configuration

Last edited by MichaelAlber .
Page last modified on Sunday June 16, 2019 02:05:14 UTC.