I have a new job! And it looks like we’ll be using mainly ZF2!
However, in this new workplace there is no Linux box to use as a development server, and so I have been tasked with setting up my development environment. XAMPP was mentioned, but you have to be joking! The best way these days to set up a dev environment (which can be moved onto any machine!) is using Vagrant, and PuPHPet.
First up, install VirtualBox. If you are using Symantex Norton AV horribleness, VirtualBox just wont work in the current release, and so you should download a 4.3.15 build, which I’ll link to for you to save time:
Next up, install Vagrant. https://www.vagrantup.com
Then, head over to https://puphpet.com, and go through the setup wizard, where you can choose what your server needs installed.
Finally open VirtualBox, and a command prompt, cd into the folder and type “vagrant up”. A lot of initialisation will scroll past, and hopefully you dont get any errors!
Now you have two options. You can either type ‘vagrant ssh’ to log in to your new machine, or follow the steps below:
Open up Putty Pageant, and import your generated key id_rsa.ppk, which can be found in the puphpet/files/dot/ssh folder.
Open the config.yaml file in the puphpet folder. Open Putty itself, and look for the private_network: key. This is the IP address you will connect to. Then click on the connection data tab and enter vagrant in as the user name. Finally go back into the session tab, give a name to the session and then hit save. Now you can connect up and have a fully working Linux Box which can be moved from machine to machine!
We dont even need to set up a Samba share! PuPHPet has set up a folder that syncs already, so have fun!
Last but not least, I had an issue setting up my SSH tunnel where I couldnt connect my HeidiSQL. Open sudo nano /etc/mysql/my.cnf and change the bind address from 127.0.0.1 to 0.0.0.0, then restart using ‘sudo service mysql restart’. Job done, ready to rock!