PhpRiot
News Archive
PhpRiot Newsletter
Your Email Address:

More information

PHP development on Mac - my experience

Note: This article was originally published at Planet PHP on 4 July 2011.
Planet PHP

A while ago I saw a lot of people writing about their PHP development environment and tools. I didn't get around to it at the time but yesterday I found me some time to write down my experiences of moving from Linux to MacOS X as primary OS for PHP Aand web development

Me and my partner in Dotvoid, a small web development and integration company, have used linux as a client OS for more than a decade. All the tools I needed for developing are there already; emacs, apache, php, MySQL, xdebug, other scripting languages, various compilers, OpenOffice and so much more. For my partner, Gimp and Inkscape have provided all the functionality for producing both designs and graphics. And all for free. Fantastic. Even so, a few months ago I suddenly decided it was time to abandon our ugly plastic laptops from Dell and Sony. I ordered two Macbook Pro. I haven't used or even touched a Macintosh since 1995. But hey, they look good.

We soon discovered that some things aren't as user friendly as we exptected. The multitouch trackpad with it's gestures is wonderful. My partner still use Inkscape and Gimp under MacOS. Still excellent tools. But she needs more precision and bought the Magic mouse which she's not very satisfied with. You can change the acceleration but not the speed. Annoying. OpenOffice also works like a charm on MacOS.

As for me I really - really - miss a decent keyboard with keys as delete, home, end, page up and page down. I didn't expect them to be missing from the Macbook keyboard. In time I guess I'll get use to the weird key combinations that is needed to replace them. I might even get used to the weird combinations needed to write backspace, brackets and curly braces. But the keyboard is not really designed for programmers. On the other hand the multitouch trackpad is great. Virtual desktops in MacOS is also a bit limited but it's not a big issue. All in all I'm slowly getting used to the hardware and the way things work under MacOS.

However, MacOS is not enough. There are PHP distributions for Mac. But as I use Ubuntu in production I use Virtualbox to run a 32-bit Ubuntu in a virtual machine. After disabling the Intel VT-x CPU optimization the 32-bit Ubuntu runs as smooth as ever. For some reason Virtualbox refuse to disable VT-x for Ubuntu 64-bit which is the reason I have to use 32-bit. With the VT-x (optimization) enabled the virtual machine with Ubuntu freeze for a couple of seconds every five seconds or so. I work in many different places, in different wireless networks and often using 3G. To make it work in any network I'm connected to I needed to setup two network adapters for the guest OS. One network adapter to allow the guest OS reach the outside world and another for communication between the host OS and the guest. I also have Virtualbox running a windows installation to allow me easy testing in a windows environment without hassle.

When buying Macbooks I also decided to buy Zend Studio for MacOS. I haven't looked back once to either PDT or emacs. It is a great feeling being able to use subversion, debug, refactor, run tests and much more in the same editor without setting things up and tweaking PDT. It just works. I'm happy with it. Let's me focus on development. And it is not as slow as for example SpringSource Tool Suite for java development. The workspace with the projects I work on I have in a shared directory accessible to both MacOS and the Ubuntu virtual machine.

In addition I use MySQL Workbench a lot. It is also available for MacOS. It is a great tool for designing and working with MySQL databases. I still use the command line a lot as I've done since 1997 when I first started working with MySQL. But with just a few clicks the Workbench let me see changes between a database and the schema, export all the changes to a database in development, staging and finally production. (I always use an ssh tunnel to push schema changes to staging and production databases as I never allow ftp or anything else.) I still run the MySQL development databases on the virtual machine though.

OmniGraffle is another application I decided to buy. I use it to create diagrams and flowcharts but also to build graphical user interfaces. Especially when designing iPhone apps. Great tool and well worth the money. You can find stencils for most purposes at Graffletopia.

Even though we still use mostly open source software, compared to a linux environment, the move to Macbook cost a lot. Especially for a small company as ours. But after a few months I still think i

Truncated by Planet PHP, read more at the original (another 3226 bytes)