At the moment I have an updated version of Mac OS 10.4 running on my MacBook and as you probably know,
Apache and PHP are preinstalled.
I started developing on a Mac along time ago,
and never needed any PHP upgrade as I never did any extensive development on my local machine.
But now I really needed a development environment with the latest Wordpress running on my Mac
and this required MySQL.
I ran into several problems and it seems that installing everything you need is the main culprit.
Starting your webserver on a Mac is easy.
This is integrated in the System Preferences under Internet and network > Sharing > Services > activate the option Personal Web Sharing or start up terminal and type:
sudo apachectl -graceful
Yes you need root permissions to do this
MySQL is needed too: download the universal package from the MySQL download page, and install. The installer will ask you for your administrator password, but everything should install without any problem.
The dmg package includes an item for the System Preferences that will allow you to stop and start the MySQL server exactly as you can stop/start the webserver. Command line does the trick too, but I try to stay out of terminal for these things so you better install that one too.
After that, download the MySQL tools: MySQL Administrator andMySQL Query browser
Once you installed the database server, you can download Wordpress, unzip the files and copy these to the webserver directory: /library/webserver/documents
The installation of Wordpress requires you to create a new database: use the MySQL administrator to create a new database and update the Wordpress config file.
Now when you install MySQL by default and try to use the PHP module preinstalled to connect to this database
you will notice … nothing. You cannot connect because the default directory for MySQL and PHP MySQL support, point to different directories.
So you have to change that.
You can read all about it on developer.apple.com
but if you follow the list below:
- open up terminal
- type: locate php.ini
- open the file that was found, probably: /private/etc/php.ini
- change the lines
- mysql.default_socket = /var/mysql/mysql.sock
into - mysql.default_socket = “/tmp/mysql.sock”
- mysql.default_socket = /var/mysql/mysql.sock
- restart Apache
And try to reconnect to your database.
Everything should be ok now, at least up to here, because I have some more problems and I will be posting more on this topic as it is not that easy to get everything running once you start to fiddle with terminal and unix stuff.

