Last Updated: 19th May 2017
WPTavern: Primary Vagrant 4.0 Updated to Use PHP 7.1, Introduces a Site Generator
In 2014, Chris Wiegman forked VVV to create Primary Vagrant, an Apache based Vagrant configuration that uses Puppet. The project has steadily evolved over the past three years and the latest release includes significant changes that require users to destroy any existing environments before upgrading.
Primary Vagrant 4.0 runs on PHP 7.1 by default. It also introduces a site generator that makes it easy to create and manage new sites. The project has incorporated Landrush, a Vagrant plugin that provides a simple DNS server without users having to edit their hosts file.
Wiegman said the direction for the release came from a combination of user feedback as well as features and fixes incorporated back from a fork of Primary Vagrant that he uses at his day job as a WordPress/Web Developer at UF Health at University of Florida. He and four other colleagues use it daily, which has helped him continually improve the project. Version 4.0 was released alongside a new extensive Wiki which Wiegman created to make it easier for his team at work.
Switching between PHP versions is not yet as easy as Wiegman would like it to be. It can be done but he doesnâ€™t recommend it. He is considering moving the project to use Docker in the future but will be sticking with Vagrant for the time being.
â€śMost Docker configs I see are really done the same way as Vagrant boxes simply swapping Docker for Vagrant,â€ť Wiegman said. â€śIâ€™ve debated moving this project to Docker but it would be done to allow more flexibility (swap nginx/mysql, php versions, etc). So far Iâ€™ve been more interested in making this as complete as possible for what I need it to do and I think with 4.0 itâ€™s finally there.â€ť
Wiegman has been considering abandoning Vagrant for Docker for more than six months. In a November 2016 post titled Vagrant Is Not the Answer for Everyone, he identified a few of its shortcomings.
â€śAfter working with Vagrant for nearly three years. and even writing a post on how great it is, I can now say without hesitation that it is not the solution I thought it was,â€ť Wiegman said. â€śI donâ€™t say that lightly either as Iâ€™m about to launch version 4.0 of my Primary Vagrant project. Instead I say it based on the expectations we have put on it as a development community combined with the ecosystem (or lack thereof) of the tools we have been using to attempt to bend it to our will.â€ť
Vagrantâ€™s lack of flexibility for configuring software versions along with the lack of good interfaces to modify things like virtual host configurations have caused Weigman to take a second look at other solutions. Although Vagrant solves many issues for those who need to reproduce a development environment, dealing with the frustrating fragility of its maintenance requirements can sometimes be a major time sink.
â€śThe need for a good Vagrant box to install and configure the various pieces that make it all work means it doesnâ€™t take much for something to fail resulting in, at best, an error message that requires another provision and, at worst, lost hours spent attempting to solve the issue in the tool that is supposed to help you build your product,â€ť Wiegman said.
The engineering team at 10up, creators of VVV, have also recognized some of the major drawbacks of using VVV, Vagrant, and Virtual Box/Hyper-V. They have recently released WP Docker as a faster, more lightweight alternative. Although the company still uses VVV in some instances, its development teams are free to choose the best solution for their projects.
For Primary Vagrantâ€™s upcoming 5.0 release, Wiegman is considering using Puppet 4 or replacing it with a new provisioning solution. He is also carefully examining a move to Docker and is experimenting to decide what will be best. Moving to Docker would offer the ability to treat PHP, MySQL, Apache, and other services more like a module that could be easily replaced, allowing for greater customization.
â€śIf I went Docker it might become Primary Docker and Primary Vagrant might be put up for adoption,â€ť Wiegman said. â€śIâ€™m not really sure yet, as thatâ€™s a pretty major change.â€ť