The instructions still need some work. I'd did some updating but haven't tried using it with a clean install yet. After reading this it sounds like there's some bigger changes. I've also been trying to switch from macports to homebrew so that'll also mean some changes to this.
Install XCode from the App Store. Run Xcode and open its Preferences (⌘+,) select the Downloads tab and then the Components sub-tab. Click the Install button on the Command Line Tools component.
Follow the directions to install Mac Ports.
To follow these instructions you need to be running as the root user using the default
sh shell. If you've got administrator permissions you can open up a Terminal window and switch users using the
sudo command then provide your password.
amorton@minivac:~% sudo su
port to install MySQL:
/opt/local/bin/port install mysql55-server
You'll need to create the databases:
sudo -u _mysql /opt/local/lib/mysql55/bin/mysql_install_db
Let launchd know it should start MySQL at startup.
/opt/local/bin/port load mysql55-server
Secure the server and set a new admin password:
Create a configuration file:
cp /opt/local/share/mysql55/support-files/my-large.cnf /etc/my.cnf
/etc/my.cnf using your editor of choice and make the following changes to the
- Change the maximum packet size to 16M:
max_allowed_packet = 16M
I was half way done adding some info how to setup pecl/pear to my guide to running Drupal 6 on OS X 10.6 before I realized I'd been running Lion for almost nine months. So it seemed like a good excuse to update it for Lion. These might be a little wonky since I did an upgrade rather than a clean install so if you notice anything please drop me a line.
Note:I'll save you the trouble of commenting, I am familiar with MAMP but would rather punch myself myself in the face than use it. If you'd like to, go right, but I'm going to continue to compile my own so I know where everything ends up.
I wanted to use memcached but didn't want to compile all the dependencies by hand and wanted to use the stock version of Apache that ships with OS X so I cobbled together the following instructions.
- Install MacPorts
- Use MacPorts to install memcached:
sudo port install memcached
peclto download the latest version of
memcachedand uncompress it:
pecl download memcached
tar xvzf memcached-*.tgz
- Build the extension using MacPort's version of
libmemcached(which was installed as a dependency of
sudo make install
- Enable it by editing
php.iniand adding the following line:
- Restart Apache:
sudo apachectl graceful
At Sony we're looking for a distributed version control system to replace Subversion—primarily Git and Mercurial. I'm very familiar with Git but hadn't done much with Mercurial so it seemed like a good idea to use it for a couple of weeks and learn the quirks. Since I'm stuck using Subversion I decided to see if it would be feasible to use Mercurial as a "super client" working locally then pushing changes back to svn. A little Googling turned up two candidates hgsvn and
hgsubversion. hgsubversion extends the commands pushing and pulling changes, giving a more native experience, so it seemed like the best choice for learning the system.
The setup is actually pretty simple but I'm documenting it for my own future reference.
Use MacPorts to Install hgsubversion:
sudo port install py26-hgsubversion
printf "[extensions]\nrebase=\nhgsubversion =\n" >> ~/.hgrc
Check that the extension was enabled:
hg help extensions
It should list something like:
integration with Subversion repositories
Now you're good to checkout from SVN (note: using the
svn+ prefix in the URL lets you use passwords stored in your keychain):
hg clone svn+http://example.com/svn/repo/trunk
Running Drupal on OS X 10.5 was a pretty huge pain in the ass. It's much easier in in 10.6 since it includes PHP 5.3 with GD and the PDO out of the box. And Drupal 6.14 resolves the PHP 5.3 incompatibilities.
In this guide I'll walk through the process I used for reinstalling OS X, then installing MacPorts and using it to install MySQL.
Note: I've shortened this up a bunch since it was first posted (originally it was using PHP 5.2 from MacPorts). I also want to make it clear that I am familiar with MAMP but would rather punch myself myself in the face than use it. If you'd like to, go right ahead since it's probably easier—and as evidenced by the commenters below—you're in good company. But I'm going to continue to compile my own so I know where everything ends up.
My side project has been writing some code to display data from iTunes on my Heathkit H19 terminal.
sudo port install jp2a imagemagick
You need to use Ruby's gem to install ncurses and appscript:
sudo gem install ncurses rb-appscript
As of 24 May 2009, I've move this code to GitHub Repository. Now there's publicly accessible version control and people can fork and share changes.
Finding myself in need of a PostgreSQL server to test some patches for Drupal core, I've decided to do a follow up to my guide to getting PHP + GD + MySQL installed on OS X.
Fortunately for me John VanDyk wrote up Beginning with Drupal 6 and PostgreSQL on OS X 10.5 Leopard which covers the nitty gritty of getting PostgreSQL server installed. He doesn't address recompiling PHP so I'll pick up the story there.
Last Updated: June 1, 2009
I was trying to install Ward Cunningham and Jim Wilson's Morse code trainer on OS X and it looks like their .dmg file doesn't work on the new Intel machines. Here's what I did to get it to build.
This guide walks through the steps necessary to setup PHP on Leopard in order to run the HEAD version of Drupal. The basic steps are installing several prerequisites then recompiling Apache and PHP from source. It could totally bork your system, I'm just writing it down so the next time I need to do this I can remember what I did. I wish I could give credit to all the places I stole bits from but I didn't do a good job of keeping notes early on.
Every time Apple releases a security update it seems to end up overwriting PHP or Apache and I end up revisiting these instructions. Since it's my personal guide I'm continually modifying it to match my current needs. For example, the last big change was adding in old
mysql extension and the new
PDO-mysql extension. The upside for you, kind reader, is that this keeps the instructions up-to-date. The down side is that when you come back in two months and try to repeat one part of this it may not work because I've changed some of the earlier steps.
Last Updated: August 26, 2009