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!

3 Responses to “PHP5 and MySQL 5 on Leopard”

  1. For anyone who might want to compile PHP by himself, on Tiger or Leopard, I detailed how I was able to on my website:
    http://www.pommepause.com/online/compile_php5_mac.html

  2. 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.

  3. @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