Installing PHP, Apache, MySQL, and Ruby on Mac OS 10.5 Leopard
If you want to get up and running quickly using Drupal on Mac OS 10.5 your best bet is to use MAMP, as John VanDyk suggests in his comments. There are MAMP setup instructions on Drupal.org.
But I decided to try moving away from MAMP. One reason is that MAMP doesn’t come with certain features — for example, I’m told that it’s hard to get SSL working. Another is that the upgrade cycle for PHP and MySQL is different from that of MAMP, and I sometimes want to be able to roll my own upgrade on my own timeframe. In addition, I want to play with Ruby technologies like Merb and Rack and Thin, and I didn’t relish trying to hack them into MAMP’s config files — though it would probably be possible to do so, the Ruby docs and blogs tend to be aimed at people who are working outside of MAMP.
So I’ve just gotten everything installed. Here’s a quick sketch of the process:
Follow Dan Benjamin’s instructions for compiling MySQL. This will involve creating
/usr/localand adding it to your path, assuming you haven’t already done so.I’m with VanDyk, who suggests running
mysql_secure_installationonce you have MySQL installed.Follow Benjamin’s instructions for compiling your own Ruby and Rubygems. This is a more dubious move, since Apple has provided preinstalled versions of Ruby and Gems in Leopard, and they work pretty well. But I decided to install my own version so that I can keep control over the upgrades.
I recommend avoiding the stock Apache. I spent a while trying to compile a PHP that would work with it, and ran into trouble. Instead, install MacPorts and use that to install Apache, then download and compile PHP.
Note that I installed MacPorts’ Apache, then downloaded and built the PHP source myself, using the following ./configure options:
./configure --prefix=/usr/local/php \
--with-apxs2=/opt/local/apache2/bin/apxs \
--with-mysql=/usr/local/mysql \
--with-curl --with-pgsql=shared \
--with-pdo-pgsql=shared,/usr/local/pgsql \
--with-pdo-mysql=shared,/usr/local/mysql \
--with-mcrypt=shared,/opt/local \
--with-openssl=shared,/opt/local \
--with-pear \
--with-gd \
--with-jpeg-dir=/opt/local \
--with-png-dir=/opt/local \
--without-iconv
I’m not sure there’s a good reason to do this instead of just using MacPorts’ PHP. For that matter, I’m not sure that using your own MySQL is better than having MacPorts install MySQL, or using the binary distribution from MySQL AG. There are lots of options. But these options seemed to work for me.
Of course, you’ve also got to set up a php.ini and an httpd.conf and get PHP and Apache pointing at them. And I’ve still got eAccelerator and XDebug to install. It’s a bit of work. I’d advise anybody who wants to avoid trouble to stick with the MAMP option.
Comments
Post new comment