Looking for more information on how to do PHP the right way? Check out PHP: The Right Way

Laravel News:
How to Use Old Versions of Laravel Homestead
Jan 20, 2017 @ 09:39:32

On the Laravel News site they've posted a tutorial by Joe Ferguson showing you how to [use older versions of Homestead](https://laravel-news.com/using-older-versions-of-homestead, the box not the app, in your development environment if there's a need.

There are two parts to Homestead: the Vagrant box and the Homestead source code (Homestead app). The Homestead Vagrant box is a snapshot of a preconfigured virtual machine ready to use. [...] We use the Laravel Settler repo to build the Homestead boxes. You have to ensure the version of the Homestead Vagrant box is compatible with the version of the Homestead app you are using.

Why would you want to use a previous version? [...] While Homestead development moves forward pretty quickly, you may not be ready to move your clients from PHP 5.5. While you should have already moved your apps to PHP 7.0 for the performance gains, I understand that because Laravel 5.1 supports 5.5, developers may want to continue using that version.

He then walks you through an example, showing how to use PHP 5.5 with Homestead and what version to put for the best support. It requires a little bit of manual fiddling around but not too much. Then it's just a simple "vagrant up" to get it running. He also includes instructions on using PHP 7.0, checking out a different version of the Homestead repository and bringing up the box similar to above.

tagged: laravel homestead version older vm application framework support

Link: https://laravel-news.com/using-older-versions-of-homestead

SitePoint PHP Blog:
Up and Running with the Fastest PHP Framework on PHP7 in 5 Mins
Aug 24, 2016 @ 11:22:46

On the SitePoint PHP blog editor Bruno Skvorc has posted a tutorial helping you get up and running with PHP 7 and Phalcon in five minutes on a Homestead Improved virtual machine.

You may remember our past infatuation with Phalcon, the fastest PHP framework.

In this post, we’ll go through the process of getting it up and running in 5 minutes on one of our <a href="http://www.sitepoint.com/quick-tip-get-homestead-vagrant-vm-running/>Homestead Improved instances. If you’re not interested in why or what Phalcon is, just skip ahead to “Setting it up”.

He starts with a brief recap of what the Phalcon framework is (including Zephir), some history behind it and the latest advancement around the framework: LTS support for v3.0. The tutorial then gets into the setup and configuration of the VM along with PHP 7 and the latest stable version of Phalcon. He then uses the sample application provided by Phalcon and getting it boostrapped and running.

tagged: phalcon php7 tutorial demo homesteadimproved vm setup configure extension

Link: https://www.sitepoint.com/up-and-running-with-the-fastest-php-framework-on-php7-in-5-mins/

James Wade:
Getting started with Docker and Wordpress
May 06, 2016 @ 11:57:31

James Wade has posted a tutorial to his site showing you how to combine Docker and WordPress after some experimentation of his own.

I’ve been meaning to get started with Docker since hearing about it in 2014. Having really enjoyed working with Vagrant, I’ve struggled to make a leap into the Docker realm. [...] My understanding at the moment is that docker takes up less resources, which for me is becoming more and more of an issue as I attempt to expand my development environments. Also, I’ve recently inherited a number of Vagrants that I discovered have varying operating systems and application versions, that vary from production.

This has unravelled a dependency hell when I came to build a continuous integration process. In light of this, at this stage, a complete rewrite of the architecture seems to be emerging as the most sensible way to being all the services in to line. I’ll be looking whether I can solve these problems (amongst others) with Docker.

He starts by helping you get all the tools you'll need installed with examples for multiple platforms (OSX, Windows, Unix-based). With those in place he helps you set up a VM as a Docker machine then get WordPress installed (complete with its database). He also shows how to use Docker Compose, using an existing WordPress instance and creating a custom image from the results (including database, environmental settings and hostname configuration).

tagged: docker wordpres tutorial example compose setup configure vm virtualmachine

Link: http://wade.be/development/2016/05/02/docker.html

Lorna Mitchell:
Test Your PHP Application on PHP 7
Jul 24, 2015 @ 09:06:53

Lorna Mitchell has a post to her site showing you how to get a PHP7 setup and working so you can test out your current application, preparing it for this next major version's release.

PHP 7 is coming, which is nice, but what does it mean for the majority of PHP developers? PHP as a community is notoriously slow in adoption, some of us are still waiting for 2012's new shiny to be available as standard on our hosting platforms. However with the performance benefits and a few really nice new features, PHP 7 is well worth everyone's attention, and it's actually quite easy to get started so here's my quick howto.

The large part of the post is the steps you'll need to get the php7dev box (from Rasmus Lerdorf) up and running, complete with a shared folder mounted from your local machine and a custom Nginx configuration. She also mentions the "Go PHP7" initiative that's aiming to help make the transition to PHP7 as easy as possible for everyone (including various extensions).

tagged: test application php7 php7dev vm virtualmachine setup configure

Link: http://www.lornajane.net/posts/2015/test-your-php-application-on-php-7

Rob Allen:
Installing XHGui via Ansible
Apr 14, 2015 @ 10:50:47

Rob Allen has posted a guide to his site today showing how to install XHGui via Ansible. XHGui is a graphical interface to view the results of XHProf, a performance evaluation tool.

I'm still using Ansible to provision Vagrant VMs. This is how I added the XHGui profiler to my standard setup.

He walks you through the five steps his process follows to get the necessary software installed and configured to get up and running:

  • Install Composer
  • Install the uprofiler PHP extension
  • Install XHGui
  • Set up for profiling
  • Set up host for XHGui website

Each step includes the commands to execute or the lines to add/update to the configurations to get the system up and working.

tagged: tutorial install xhgui xhprof ansible build vagrant vm virtualmachine

Link: http://akrabat.com/installing-xhgui-via-ansible/

Etsy Code as Craft Blog:
Experimenting with HHVM at Etsy
Apr 08, 2015 @ 08:49:20

On the Etsy "Code as Craft" blog they've posted an article about their experiences in experimenting with HHVM at Etsy and some of the differences it makes.

In 2014 Etsy’s infrastructure group took on a big challenge: scale Etsy’s API traffic capacity 20X. We launched many efforts simultaneously to meet the challenge, including a migration to HHVM after it showed a promising increase in throughput. Getting our code to run on HHVM was relatively easy, but we encountered many surprises as we gained confidence in the new architecture.

They start with a brief overview of what HHVM is for those that aren't sure and talk about where their focus was in these experiments. They list out some of the main reasons for trying out HHVM and the role of concurrency in their current application. They started with the "minimum viable product" and compared benchmarks between PHP 5.4 and HHVM on several endpoints. They also show how they "teed" incoming requests to both servers to ensure that the responses were the same across both. They also talk about using employee-only traffic and the overall statistics for when they released the HHVM version internally. They also talk about some of the undocumented features to keep an eye out for if you're thinking of switching: "warming up" the requests to align them in JIT memory, using perf(1) for profiling and the use of the HHVM interactive debugger (hphpd).

tagged: hhvm etsy experiment performance throughput statistics hiphop vm

Link: https://codeascraft.com/2015/04/06/experimenting-with-hhvm-at-etsy/

Rob Allen:
Building and testing the upcoming PHP7
Mar 30, 2015 @ 10:14:08

Rob Allen has posted a guide to building and testing PHP 7, the next upcoming major build of the PHP language (released sometime later this year).

The GoPHP7-ext project aims to ensure that all the known PHP extensions out there work with the upcoming PHP 7. This is non-trivial as some significant changes have occurred in the core PHP engine (related to performance) that mean that extensions need to be updated. In order to help out (and prepare my own PHP code for PHP 7!), I needed the latest version of PHP7 working in a vagrant VM. Fortunately Rasmus has created a such a VM called php7dev, so let's start there.

He walks you through the process of grabbing the latest version of the virtual machine and set it up as a Vagrant VM instance. He talks about the different PHP versions contained in the VM and how to update PHP 7 to the latest pre-release version. Finally he talks about building an extension on the VM (he uses the apfd extension) and how to configure the VM to be able to test your own code too.

tagged: php7 test vm extension rasmuslerdorf vagrant tutorial

Link: http://akrabat.com/building-and-testing-php7/

Lorna Mitchell:
XHGui on VM, Storage on Host
Jan 05, 2015 @ 12:09:08

Lorna Mitchell has a new post today showing you how you can use XHGui in a virtual machine, sorting the resulting performance data on the VM rather than your local machine.

I'm doing some performance tuning on a project at the moment and my favourite tool is still XHGui - but it's designed to run on the same machine as its victim and since this is a vagrant VM, the chances of me destroying the machine and therefore the data are pretty high! Instead, I set it up to store the data onto the host and I thought I'd share how I did that. All these instructions for Ubuntu on both host and guest, and I've tried not to be specific about the vagrant elements in order to focus on how the pieces fit together rather than what you should type.

She walks you through all the steps you'll need to get the software up and running as well as configuring the actual guest VM to direct the data to the right place. She sets up the data source to push the results into (a MongoDB) and configures the PHP installation with an "auto prepend" of the XHGui header file. Finally, she includes the commands you'll need to view the data on the VM itself, running the built-in PHP web server as an ad-hoc instance on the VM itself.

tagged: xhgui xhprof mongodb vm virtualmachine tutorial localhost

Link: http://www.lornajane.net/posts/2015/xhgui-on-vm-storage-on-host

Build a VM for Drupal 8 with Vagrant
Nov 26, 2014 @ 10:22:22

A new tutorial has been posted on the php[architect] site today showing you how to build a VM for Drupal 8 with the help of Vagrant.

At this year’s php[world] hackathon, I spent my time getting a Vagrant machine configured to run Drupal 8. I know there are other options, like Acquia’s own Dev Desktop, or even Zend Server. However, I like using Vagrant to run my LAMP stacks, especially on OS X. I’ve never been able to easily run xAMP on non-Linux machines. Installing MySQL can be a pain, system updates can change the version of PHP you’re running, and some PHP extensions are really difficult to build—even with Homebrew. Vagrant simplifies getting a working development environment running by automating the provision of a virtual machine for you, usually with a tool like Chef, Puppet, or Ansible.

Oscar (the author) took advantage of some time at the php[world] hackathon to create the necessary files for building this environment. He walks you through the steps to creating the basic vagrant file with "config" options (explaining each one) and walks through the setup of additional options, software like Apache and Drupal. He then sets up the Ansible configuration to create the box, run the provisioning and configuration of the resulting server. Finally, he shows the result of the install if everything was successful.

tagged: drupal8 vagrant vm virtualmachine tutorial introduction configuration provision

Link: http://www.phparch.com/2014/11/build-a-vm-for-drupal-8-with-vagrant/

Rob Allen:
Using Phing to SSH into a Vagrant box
Nov 25, 2014 @ 10:22:55

In a quick new post to his site Rob Allen shows you how to have Phing SSH into a Vagrant box as a part of the VM creation process. In his case, he uses it to run database migrations.

Now that I've started using migrations, I've discovered a minor irritant. I run this project on a Vagrant VM and have discovered that I keep forgetting to ssh into the vagrant box before running the migrations script. The obvious solution is to automate this and I decided to use Phing to do so.

He walks through the installation of the libssh2 software (if you don't already have it) and the ssh2 PHP extensionSshTask to make the connection as the "vagrant" user and execute the given PHP command.

tagged: vagrant ssh phing migrations automate tutorial vm virtualmachine

Link: http://akrabat.com/php/using-phing-to-ssh-into-a-vagrant-box/