Creating your own PHP dev-env in Vagrant: Bonus 2

June 3, 2016

Table of Contents

Part 1

Part 2

Part 3

Bonus 1

Full Code Base on GitHub

Slowly but surely we get to the end of this series. In this last post, I will write about database access from the host system, while your database is running on the guest machine. Therefore I will present two strategies to do so. Sure you also can

via the terminal and access the database on the CLI. But viewing and fast editing of some tables is much more comfortable from a GUI. In this post I will go over two MySQL applications: MySQL Workbench and PHPMyAdmin. While the Workbench will be installed on your host system and access the database via ssh, PHPMyAdmin will be installed on the guest system, on the existing apache web server. Here we are able to access it over the hosts browser like our web app.

read more …

Tags

Creating your own PHP dev-env in Vagrant: Bonus 1

Table of Contents

Part 1

Part 2

Part 3

Bonus 2

Full Code Base on GitHub

In the previous posts we’ve successfully set up a development environment for PHP. In the following posts I will present some bonus things, which you can do, to optimize your work with vagrant. In this post I will show you how to set a virtual host in apache inside your guest system. Because IP addresses can be forgotten quite easily, it’s much more handy to have a short named address under which you can access your web app. In this project we will create a virtual host for our main project directory called mysite.dev. So let’s get started!

read more …

Tags

Creating your own PHP dev-env in Vagrant: Part 3

Table of Contents

Part 1

Part 2

Bonus 1

Bonus 2

Full Code Base on GitHub

In the previous post we’ve set up the apache web server successfully. Now it’s time to add MySQL and PHP to finish the LAMP stack.

read more …

Tags

Creating your own PHP dev-env in Vagrant: Part 2

Table of Contents

Part 1

Part 3

Bonus 1

Bonus 2

Full Code Base on GitHub

 

In the last post we installed vagrant and enabled the vagrant settings we need in the vagrantfile. We have set a base image of ubuntu 14.04, made a synced folder and enabled a private network connection between host and guest system. Now it’s time to write our first shell scripts, which will configure our guest system to serve as a web server.

read more …

Tags

Creating your own PHP dev-env in Vagrant

Table of Contents

Part 2

Part 3

Bonus 1

Bonus 2

Full Code Base on GitHub

 

In this series of posts we will be creating a development environment(dev-env) for PHP with the help of vagrant. Vagrant is a thin wrapper around different virtualization software projects like virtual box, which we will be using in this tutorial. The so called wrapper of vagrant is a configuration file, written in the ruby programming language. But don’t worry, you don’t need to be an expert ruby progammer to setup a dev-env in vagrant. Everything we use it for, are some variable assignments. In this configuration file we can tell the virtualization software, which operating system and software to install and how to configure everything. Our ultimate goal here is, if the environment is started, everything is setup already. Finally we want to get a fully configured LAMP stack with a running apache webserver, a mysql database and PHP. As always there are many different ways to glory. For example does vagrant offer different ready to use recipes via chef. There is also support for Puppet, a unified configuration language for different systems. We won’t use any of these plugins in this series. Everything we will work with, are some bash scripts and the vagrant file. I have chosen this path, because I want to keep the full control over everything. On the other hand it’s also more work, but I think it’s worth it. Before we go into the details, lets talk about the advantages of a vagrant based development environments.

read more …

Tags