Macs. OK, they’re good

This post isn’t going to mean much if you’re not a developer - just a quick warning before I start.

So this past week I’ve been struggling to get my PC to serve up a website properly. It’s a pretty complex site, with a 50MB MySQL database,PHP & Apache and the bloody PC just wouldn’t do it. I’ve only ever done this kind of thing on Windows, and I’m not that good at it to begin with.

The only option seemed to be a newly build PC server, and I don’t have any computers lying around that I could do that on. So I decided as a last resort I’d see if I could set up the proper environment on my mac. I knew it was possible, but….. it’s a mac. And I don’t exactly have fingertipcontrol of the inner workings of the thing.

Step 1 - So first things first; Apache. Yep, OSX has it built in and I’ve seen it working, but I needed to change the httpd.config thingy & the only way to do that was Terminal. Command line editing - a brave new world. I can do that now. Open, edit and save theApache config file and restart the server, debugging a broken server if I’ve cocked it up. So that was step 1 out of the way & PHP 4 was enabled.

Step 2 - MySQL. I found a package and that went without a hitch. I now have a database server running and all seemed to be going pretty well. Could PHP connect to it? Hell no - that would be too easy. It uses some kind of wierd socket thing & it required a bit more Termial editing of the PHP ini file. Then it worked. Wahey.

Step 3 - PHP 5. PHP 4’s not good enough it seems, but hey - there was a useful package for the mac here and ping…. we have an Apache server running PHP 5, connecting to a MySQL database. Not bad

Step 4 - SVN. Checking the code out of the SVN repository in Seattle was easy enough & another tweak to the Apache config meant I had everything pointing in the right direction.

Step 5 - Database replication. The DB I need to create locally is 50MB. Way too large for PHP admin or any of the other ways I could think of. BigDump. That’s the badger. . A few little tweaks here and there and bosh… a proper local copy of the development DB.

At this point I’ve got to the same stage as I did with the PC. So I still might have the same problem. But no! It actually worked. We now have a stable local development environment environment running on the macBook, which can be viewed and interacted with from all the computers on my local wireless network. Fuckin‘ A!

Step 6 - Now I want other people on my wireless network to be able to work on the files in that install on their PC’s so that Martin and I can develop as a team. No problem. Turn on Windows Sharing. No joy. The files which make up the website are not in the group of files it’s possible to share. Not until you create a sym-link-thingy on the desktop, which CAN be seen by our windows boxes.

So it works. And macs are good. Who knew?

Did you enjoy this post? Why not leave a comment below and continue the conversation, or subscribe to my feed and get articles like this delivered automatically to your feed reader.

Comments

MAMP makes it much easier and Heddress even easier still!
Check out this for a really easy dev environment on the mac http://shauninman.com/archive/2006/12/04/mamp_headdress_and_quicksilver

Leave a comment

(required)

(required)