Wednesday, September 11, 2013

Drupal 7 on OSX 10.8, with Apache 2.2, MySQL, and PHP 5

This post is more about my experience of using a local instance of Drupal on my OSX box. The following are links about resources I found extremely helpful. Basically, I installed 2 versions (Drupal 7.2 and , and you have to jump through some hoops because although OSX ships with Apache and PHP, you need to now enable some settings (via cmd line or other tools) in order to have web sharing activated again (the silly prompt from the Preferences Pane is now gone *insert_sad_face*)

SITES:

1) This one helped me get the AMP stack going on my box (it also had some good step by step instructions about using phpMyAdmin)
http://www.coolestguyplanettech.com/downtown/install-and-configure-apache-mysql-php-and-phpmyadmin-osx-108-mountain-lion#apache

2) Getting a few steps closer, this site gave me some more info about getting the info setup correctly for Drupal as well as AMP stack
http://drewish.com/2012/07/26/drupal-on-mountain-lion-os-x-10-8/

3) A few stack overflow links
http://stackoverflow.com/questions/1676688/php-mysql-connection-not-working-2002-no-such-file-or-directory
and
http://stackoverflow.com/questions/1819592/error-when-connecting-to-mysql-using-php-pdo

4) And I cannot forget the infallible directions from Drupal.org
https://drupal.org/documentation/install

5) and for good measure, once I installed phpMyAdmin, the help docs helped :)
phpMyAdmin/doc/html/setup.html#setup_script
and
phpMyAdmin/doc/html/faq.html

So almost all of this got me to the right place, though it took a few hours to get screens working, and the DB didn't want to initially work. Why? Well, because the pdo_mysql.default_socket was not commented out...huh? Yeah, it didn't make sense to me for a bit. I searched lord google for things about the following error messages:

Warning: PDO::__construct(): [2002] No such file or directory (trying to connect via unix:///tmp/mysqld.sock)

Yeah, that kind of message didn't help at all, until I started changing my php.ini file around, and realized that that specific line, though correct (in a couple different ways, might I add), was wrong. My uneducated guess is that pdo_mysql is for Unix only, and as I am on OSX, it was wrong. Just commenting it out made it all better, install scripts started running on both installs, cats and dogs started sleeping together, and donuts began raining from the heavens...Ok, the last two didn't happen, but still, I hope this helps someone else besides me.

No comments:

Post a Comment