Thursday 6 August 2009

Getting MySQL running with PHP on a Mac

I've just been trying to get PHP and MySQL running with Apache on a Mac (PHP 5.2.8 and MySQL 5.1.33 running OS X 10.5.7). Somehow I kept running into the following error when trying to get a PHP script to connect to MySQL:

mysql_connect(): Can't connect to local MySQL server through socket '/var/mysql/mysql.sock'

Here's how I fixed it.

Monday 3 August 2009

How to configure an Airport on/off shortcut key on a Mac


****Update - 10th February 2010****
This worked well in Leopard, but I haven't got it to work since upgrading to Snow Leopard. Does anyone have a fix?

The Problem
One of the things which has always bugged me about my Mac is the lack of a shortcut key to turn the Airport WiFi on and off. At home I connect using WiFi and in the office I plug into a wired ethernet connection, so I wanted to be able to turn the Airport on or off with a shortcut key instead of having to use my fat fingers and the mouse to click on the fiddly little Airport symbol in the menu bar. Unfortunately, Apple didn't build an Airport shortcut key into OS X. I'd been looking for a solution to this problem for ages, and now I've finally got it worked out.