PHP5 and MySQL 5 on Leopard

A few quick notes about building MySQL 5.x and getting it working under Leopard:

  • Follow Dan Benjamin’s excellent MySQL on Leopard tutorial.
  • Copy the PHP configuration example to the actual expected location: sudo cp /etc/php.ini.default /etc/php.ini
  • Edit it, and add /private/tmp/mysql.sock to both mysql.default_socket and mysqli.default_socket.
  • Save, and restart Apache: sudo apachectl graceful

Once completed, the default PHP5 setup that comes with Mac OS X 10.5.x will be able to communicate with the MySQL version built using the above linked tutorial. Time to get developing!

PHP5 and MySQL 5 on Leopard

3 thoughts on “PHP5 and MySQL 5 on Leopard

  1. Colin says:

    Thanks for that, brand new mac owner after years of Windows/ Unix development and I was going nuts trying to figure out why it wasn’t using the standard mysql socket.


  2. crazyj says:

    @Guillaume Boudreau

    You say “For anyone who might want to compile PHP by himself, on Tiger or Leopard, I detailed how I was able to on my website:” but then your web site CLEARLY says “Note that the following will only work on Tiger, not on Panther nor Leopard!”

    Were you being intentionally deceiving with your post?


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s