2014-08-03

Debugging PHP tips and techniques (part 2)

An alternative to setting up the PHP server on your PC, Mac or Linux machine is to create a virtual server within a virtual machine (VM) running on your machine. This would closely emulate the final deployment environment. As the VM is usually running Linux, it would support things like case-sensitivity in the web server (something which causes grief on windows based web servers).

There are a number of free solutions for creating VM servers on your operating system.
VirtualBox is available on most platforms as long as you are running on Intel.
VirtualBox: https://www.virtualbox.org

VirtualBox is a powerful x86 and AMD64/Intel64 virtualization product for enterprise as well as home use. Not only is VirtualBox an extremely feature rich, high performance product for enterprise customers, it is also the only professional solution that is freely available as Open Source Software under the terms of the GNU General Public License (GPL) version 2.

Presently, VirtualBox runs on Windows, Linux, Macintosh, and Solaris hosts.

Vagrant: http://www.vagrantup.com
Vagrant is a tool that allows quick setup of development environments using virtual machines. It works well with VirtualBox.


WHY VAGRANT?
Vagrant provides easy to configure, reproducible, and portable work environments built on top of industry-standard technology and controlled by a single consistent workflow to help maximize the productivity and flexibility of you and your team.

To achieve its magic, Vagrant stands on the shoulders of giants. Machines are provisioned on top of VirtualBox, VMware, AWS, or any other provider. Then, industry-standard provisioning tools such as shell scripts, Chef, or Puppet, can be used to automatically install and configure software on the machine.


To make the configuration of PHP itself easier, we can turn to PuPHPet
PuPHPet: https://puphpet.com/
Configuration of your Vagrant+VirtualBox is as easy as choosing from a menu of options.

But, you may want to try Docker instead of VirtualBox as a Vagrant provider
http://www.tylercipriani.com/2014/05/25/lightweight-portable-vagrant-docker.html

The latest versions of Vagrant (1.6.2, as of May 26th) can actually use docker as a provider, that is, as an alternative to VirtualBox. Using Docker as a provider means that you can run a fully-independent development enviroment, on your host machine without the overhead of VirtualBox. 



No comments:

Post a Comment

Github CoPilot Alternatives (VSCode extensions)

https://www.tabnine.com/blog/github-copilot-alternatives/