Setting up a half-assed PHP development environment on Windows

I, personally, don’t like to develop on Windows, but sometimes I am sitting at my desktop computer(that I use mainly for gaming) and need to code or fix something. Here I will present the setup that I use.

Cygwin64

Have you ever wondered to use git, gcc, make and even emacs on Windows? Cygwin is the easy way to achieve that. Download and run the Cygwin installer. The base package works fine, but make sure to install net/openssh and devel/git packages are selected.

Now just set your system’s PATH environment variable including the cygwin /bin/ folder path.

ConEmu

conemuThis step is not entirely necessary, but I don’t regret using it. Download and install ConEmu. Open the Settings (Super+Alt+P), select the Startup entry from the tree menu and select Specified named task to Cygwin Bash.

 

Vagrant and Scotch Box

I used to roll my Vagrant boxes using PuPHPet. Recently on Windows I had some issues with shared folders settings, I am now using the preconfigured box from Scotch Box.

First download and install VirtualBox and Vagrant. Then clone and setup with vagrant, the first time will take a while since Vagrant need to download the image.

git clone https://github.com/scotch-io/scotch-box.git scotchbox
cd scotchbox
vagrant up

Before shutting down your computer, you should suspend your box.

vagrant suspend

You can ssh into your box using the following command:

vagrant ssh

Visit http://192.168.33.10/ to access your box.
This setup is far from perfect, but it works for me. A while ago I used JetBrains PhpStorm as IDE to develop, recently I changed to Atom simply because it loads faster and I don’t use all the features of PhpStorm.