Latest: MySQL 5.1, PHP 5.3, and Mac OS X 10.6
After upgrading to Snow Leopard (Mac OS X 10.6) I found that my local MySQL installation no longer worked. Also, my local Apache server using PHP 5.2 no longer interpreted .html files as PHP as I’d set up before. I did some digging and came up with the following things to get it working again. Hope this helps.
MySQL
There isn’t a MySQL installer package for Snow Leopard yet so you’ll have to build it from source. (I know, really scary sounding, huh. I hadn’t compiled anything before this and was intimidated. But it’s easy. Promise.) Follow this extremely easy-to-follow tutorial by Dan Benjamin and then come right back here for the rest.
Apache & PHP
Welcome back. By now you should be able to connect to your shiny new MySQL instance. Now, if you load any PHP pages that use any of the date functions you’ll see this error (or something similar):
Warning: date() [function.date]: It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier.
PHP 5.3 now requires the timezone to be specified instead of trying to guess at it.
- Open Terminal (/Applications/Utilities/Terminal).
- Copy the built-in
php.ini.defaultfile tophp.iniby typingsudo cp php.ini.default php.iniand pressing Return. Supply your password. - Edit
php.iniby typingsudo open php.ini. It should open in your default text editor. - Search the file for the phrase “timezone”. You’ll find a line that reads
;date.timezone =. Change it todate.timezone = America/Denver(or whatever timezone you choose from this list). Remember to delete the semicolon from the beginning of the line. - Because of some code I share with colleagues, I ended up needing to restore the
short_open_tagattribute by finding that phrase and setting the value toOn. - Also, MySQL couldn’t connect to anything until I commented out the
mysql.default_socketproperty by placing a semicolon at the beginning of the line. This lets it use the built-in value instead. - After making these changes to your
php.inifile you need to restart Apache to get it to read the new values in. In Terminal typesudo apachectl gracefuland test your local php code in your browser.
Happy coding!
Not Latest
-
“Add to Shelfari” bookmarklet for Amazon.com
I wrote a little bookmarklet (based on the one I found from goodreads.com) to add [...]
-
Come, let us listen to a prophet’s voice regarding the economy.
Gordon B. Hinckley warned the world about the dangers of living beyond one’s means. I’ve [...]
-
Blender / Lemony Snicket on Libraries…
I’ve just finished reading Lemony Snicket’s Horseradish. I rendered one of the quotes in Blender. [...]
-
An Event Apart (San Francisco)
Just sitting here waiting for the keynote by Jeffery Zeldman. It’s really exciting finally being [...]
-
Service Generator
Ben Markham, a BYU alumnus who served as an LDS missionary in Ghana discovered a [...]
-
Get Daemon Tools working after Vista Ultimate upgrade
It took me a few days of scouring Google searches to find the solution to [...]
Asides
OS X Terminal Mail directory
In case anyone is searching for this: the mail for terminal directory (i.e. the mail that shows up when you have cron jobs running) is /var/mail/username where username is your account name. I was trying to get rid of some old mail files and couldn’t find this very easily with a simple search. HTH!
Wordpress MU 1.5.1 Released
Doncha has done a great job getting Wordpress 2.5 ported over to MU. MU 1.5.1 is available now.
Online LDS Scriptures now available in Portuguese
Hooray! The Portuguese edition of the LDS Scriptures is now online.
iPhone is 2007 Invention of the Year
Time magazine declared the Apple iPhone as 2007’s best invention. Hard to argue with that.
Hilarious Facebook song
Funny guys Rhett and Link put together a Facebook song that says it all. Check out the video.
Best Vista laptop is a Macbook Pro :)
PC World tested and noted that the top-performing Vista laptop is actually a Macbook Pro. The irony is almost painful.



