16 March 2010

apt-get install yum install on MAC OS X


The reason we bought a mac in the first place was:

1. We get the benefits of Linux
2. With a usable windowing system
3. And it's sexy

So we do a little searching and find out that our little dream is shattered as we have no apt-get install, nor any yum-install.

It's not all that bad. There is good news. There is software called Macports, where the good open sourrce folk have ported a lot of the Linux software to Mac/Darwin. This includes good ol utilities such a rsync, postresql, postfix, mysql and friends...

Unfortunately, it's not just as simple as downloading the MacPorts .dmg file and installing it. Because apt-get and yum typically download source code and compile it for your system, macports needs to do this too. By default, the GCC compiler doesn't come with your mac, and the ONLY way I've found so far to get it on your system, is to install X-Code, which is pretty the best part of a gigabyte.

Fortunately, xcode is free software and ships with your OS, so stick in your OS X cd and install X-Code. If you lost your OS CD, you can create an ADC (Apple Developer Connection) account, and download X-Code here:

http://developer.apple.com/technologies/xcode.html

Once installed, GCC, Make and related tools will be automatically installed and configured.

Then it's a simple matter of downloading and installing MacPorts. Get the DMG here:

http://www.macports.org/install.php

You may want to run a quick update to make sure everything is set up correctly:

sudo port -v selfupdate

And apart from that, it works just like yum or apt-get.

sudo port install ...

Enjoy the best of linux on your machine, free of charge. Be sure to also check out WINE (Windows Emulator) for a lot of fun running Windows software on your Mac, free, without a copy of VMWare, Windows, nor Parallels!

04 February 2010

How to Install PHP on MAC OS X Snow Leopard - The Easy Way

Installing PHP5 on Snow Leopard is easy. It's already there. The only thing is that most web sites say "uncomment" the line, but I didn't see the line at all.

You can make sure that the module is there before enabling it. Mine was in:

/usr/libexec/apache2/libphp5.so

So, I just added one line to:

/etc/apache2/httpd.conf

and that was:

LoadModule php5_module /usr/libexec/apache2/libphp5.so

then I restarted apache by typing:

sudo apachectl restart

If something is wrong, use the -t directive to troubleshoot.

sudo apachectl -t

I'll try and answer any questions you have if you post them here...