Monthly Archives: September 2016

Setting up Vagrant

You’ll need Virtual box so download and install that

Then you’ll need vagrant

You can check out the getting started guide here:

Simple example:

Open a terminal session (iTerm2 on mac or cmder windows) and run:

vagrant init hashicorp/precise64
vagrant up
vagrant ssh
vagrant destroy

Lets make our own

mkdir MyFirstVagrant
cd MyFirstVagrant/
vagrant init

Lets commit it to a github repo so we have source control on it.  Go to and create a repo.  Replace the url below with your .git file.

echo "# Vagrants" >>
git init
git add
git commit -m "first commit"
git remote add origin
git push -u origin master

Lets find a box we want to add to our vagrantfile

I chose the most popular vagrant ubuntu/trusty64.  Edit the vagrantfile and Below “Vagrant.configure(“2″) do |config|” add: = “ubuntu/trusty64”
config.vm.box_version = “20160926.0.1”

exit your editor and do

vagrant up
vagrant ssh

Then you have your ubuntu server to setup how you want.

Example of setting up PHP 7 dev vagrant:

Provisioning w/ external shell script:

  config.vm.provision "shell", path: ""

in you could run an update and install of apache, php:

sudo apt-get -y update
sudo apt-get -y install apache2 php7 libapache2-mod-php7

Give a network IP address "private_network", ip: ""

Want to do this on a power System?  Well VirtualBox doesnt appear to support powerpc so looks like you have to use powerkvm instead.

How to use Vagrant with PowerKVM

Execute SQL remotely on an IBM i via PHP’s PDO ODBC from a Windows or Linux

You’ll first have to configure an ODBC connection “System DSN”/”System Data Source” via the “iSeries Access ODBC driver” or it might be call the IBM i Access driver which you can learn how to download and install here:

Here’s some of the ways to configure the odbc connection

Once you have the ODBC connection setup you can use it in PHP and here’s a Simple Example on how to execute SQL remotely and safely on an IBM i via ODBC.  Note you won’t want to dump the error info in production its there to alert you about errors.

Here’s an example on how to run a SQL extenal stored procedure


Make sure to enable SSL to encrypt your SQL statements that are sent



Run C:\Windows\SysWOW64\odbcad32.exe and edit connection options and make sure ssl is selected or IBM i navigator is defaulted to sslodbc windows secure.png


Setup stunnel

guide is here: under 2.6 Encrypt the connection with Secure Sockets Layer

Other References: