Jul 31 2009

My recommended setup for web-developers on OSX

If you want to do any kind of web-development on the Mac that involves PHP and the Apache webserver, you have a few options:

  1. Use the Apple provided, built-in apache plus PHP. You can turn on the web-server (with PHP) in your system preferences menu as ‘Web Sharing’. From that point on your Sites directory will function as your web document root (~/Sites). The bad thing with this setup is that you cannot just install any kind of PHP module, or apache module. Or if you do, you will regret it once the next system update arrives from Apple (which - by the way - overrides all your changes…)
  2. Download and use MAMP. I have seen it used in lots of tutorials and books. The only bad thing with it, is that it is quite spartan, and has been updated quite a long time before (2008-08-27) - seems that its devs are abandoning it for good. Not recommended.
  3. My recommendation is to use XAMPP. The good thing with XAMPP is that it is more or less regularly updated with not so major breaking changes, but still keeping you on top of the almost very latest PHP / MySQL releases. XAMPP is also cross platform in the widest sense of the world. This is good mostly for Mac / Windows users, but some Linux users could also benefit. XAMPP is available for the Mac, Windows, Linux, and Solaris platforms.

I have been using XAMPP for almost 2 years now. I have just recently upgraded my previous pre1.0 version to its latest 1.0.1 version - which includes MySQL 5.1.33, PHP 5.2.9, Apache2.2.11 with mod_ssl support and tons of other modules. You can download the OSX version from here.

If you use XAMPP you will just unpack its files into your /Applications folder (the path must be this, otherwise all the scripts will break inside), then drag /Applications/XAMPP/XAMPP Control to your dock and you can start enjoying it.

I do have a few recommendations for OSX users though.
None are too important, it’s just my way of thinking.
› Continue reading


Jul 13 2009

Netbeans 6.7+ IDE: use it for PHP as well

Here’s why:

So you’ve been developing for a while. Coding PHP, etc. You must have a favorite IDE (code editor)…

My favorite is / was TextMate. I just loved one its fastness and mainly its ’sunburst’ dark background based color theme. The only thing I did not love with TextMate is its lack of automatic code completion / suggestion. It has none of that - and my feeling is that in such times of huge frameworks (yii, kohana, symfony, zend comes to mind) you can just always try to look up something. Once you’ve tried automatic code completion and suggestion (with docs automatically lifted from code) you can’t go back.

Add to this the open-source nature of Netbeans, and its support for CVS, SVN, PHP, Ruby, Python - this is just my list of required languages because I love ruby on rails, and the django framework, besides php of course -. Its support for code-snippets, auto-completion, debug (via xdebug for PHP). Also let’s not forget that this is an IDE written in Java, and it supports Java as a programming language as well (with GUI designer, debugging and so on). It also has a project navigator and a code navigator as well (class methods, attributes, etc.). It also quickly indexes your source code tree, so you can easily look up code - without even lifting your hand off the keyboard. It is just amazing.

And despite it’s being java - it’s speed is good. Well compared to TextMate it’s slow, but it does so many more things…

My only problem with it so far is the built-in default color profile ‘netbeans’ - › Continue reading


Jul 9 2009

How to make windows recognize usb drives (sd cards) as local hard drives

Nowadays you can buy huge usb drives / sd(hc) cards on the market. 16gb sd cards are selling around USD 30-40 right now - and I imagine it’s the same for usb drives. The theoretical max. of an sdhc card is 32 gb which is enough for a lot of purposes.

Lots of laptop and consumer devices have an sd card slot as well. If you use one such card / usb drive for your computer you might want to partition it for several reasons (just imagine dual booting linux / windows from an sd card - possible! see my previous post on how to make xp boot from an usb drive - it’s very much the same with an sd card as well).

So to the point. The problem with windows (xp) is that if it recognizes a device that is connected as removable (usb hard drive, sd card, etc.) then it will only allow you to format / have one partition on it. This is enough for a lot of users (e.g you use the card in your camera).

Windows also does not allow you to see more than one partition from a removable drive - even if you have partitioned it to 2 or more sections with linux (gparted) or mac os x ( via the built in disk utility).

The problem is that windows only allocates a drive letter to the first partition found on a removable drive - and the rest is just not accessible.

How to solve this problem?

The answer is simple: › Continue reading