Wed, 7 Sep 2005

Build PHP 5.0.5 for Mac OS X 10.4

— SjG @ 8:39 pm

I’m trying to track down a bug in my CMS Made Simple PHP code where I did something stupid with references (a rant on the PHP pass-by-value model available upon request). So it only manifests with PHP 4.4.x or PHP 5.0.5, since that’s where they finally decided to get strict with us idiot slackers. Neither of these are available as binary packages on Mac OS 10.4.

I was dismayed, shocked, stunned, dazed, and confused to learn that PHP was no longer a package for Fink. Dammit! Now I have to figure it out for myself. Crap.

With the help of a variety of pages out there on the web (especially this one), I was able to do it. Here’s how:

Install Fink, if you haven’t already. I use the “unstable” packages. Read the FAQ, and muck around with it for a while until you feel ready to proceed.

Install a wholehellovalotta packages using Fink:

  • libjpeg
  • libtiff
  • libpng
  • libxml2

I also installed the Fink version of MySQL server 4.1, client, and a bunch of shared libraries.

Next, gotta build ZLib:
curl -O
cd zlib-1.2.3
./configure --prefix=/sw
(su if necessary)
make install

(I did my install work in /sw/src, but you could do it somewhere else if it pleases you more. Just take note of this other location when you need it later.)

Finally, we get PHP 5 .0.5 from

tar xzvf php-5.0.5.tar.gz
cd php-5.0.5
./configure --with-libjpeg=/sw --with-libtiff=/sw --with-libpng=/sw \
--with-gd --with-mysql=/sw --with-xml --with-apxs --with-exif \
--with-jpeg-dir=/sw --enable-exif --with-png-dir=/sw --with-zlib-dir=/sw \
(su if necessary)
make install

Now, I already had a version of PHP installed before this, provided by Marc Liyanage’s excellent binary packages available at his page, so I didn’t need to tweak my php.ini file. If you do, you’d probably do something like:

cp /sw/src/php-5.0.5/php.ini-recommended /usr/local/lib/php.ini

and then edit into submission. You can also use the more general php.ini-dist instead of php.ini-recommended. I don’t know why they provide both — probably to confuse idiots like me. You’ll also need to register the PHP Mime Type with Apache. Edit your /etc/httpd/httpd.conf file, and add either to the general area or to a specific virtual host the line:

AddType application/x-httpd-php .php

Now test it! Create a test file in your web root containing:

<php phpinfo();>

and browse on over to it. With any luck, you’ll be greeted with ahappy PHP 5.0.5 banner.
Celebrate this with red wine. Preferably good red wine. Then get back to coding. As should be obvious, I decided to document instead of code, but I didn’t skip that vital red wine step.


Powerbook HD Upgrade

— SjG @ 2:09 pm

Since I have this unreasonable need to keep all of my digital photos on the Powerbook, I’m running out of disk space. Gee, you’d think 60GB would be enough for just about anything. But with 30GB of graphics files (21GB of which is just photographs), space gets used up quickly.

The eventual plan is to use iView MediaPro2 for keeping the pictures organized, Photoshop for manipulating them in any way necessary, and come up with some bridge to Gallery2 for publishing collections on the web. We’ll see.

In any case, the problem arises of disks. The one I’m currently considering is the Seagate Momentus 5400.2. I like that Seagate still has a five year warranty. The drive’s 100GB, which would give me another 40GB. That’s about 15 overseas trips worth of pictures, or, if I’m lucky, enough to tide me over until I get my Super New Intel Mac Notebook with its 250GB hard drive in Spring of ’07.

Update: Somehow, I’d missed the ST9120821A. That’s 120GB! Wheeeeee!

Tue, 9 Aug 2005

Cool Mac OS Programs

— SjG @ 12:53 pm

Here are three really nice programs I’ve found (or rather, people have pointed out to me) for the Powerbook lately:

iScroll2: Two-Finger-Scrolling with pre-2005 PowerBooks and iBooks at RazzFazz’ Homepage. This is particularly nice, since it is highly configurable: vertical scrolling, horizontal scrolling, circular scrolling (i.e., iPod wheel scrolling), and even tap-to-click mappings. It seems to be a really well done piece of code.

MyBattery coconutBattery at This is more than just a battery monitor, since it gives some “absolute” information, such as original maximum battery capacity (in milliamp-hours) and current battery level, capacity, charge cycles, and estimated runtime. We all know deep down that our batteries are slowly decreasing in their capacity as they age. This gives a tangible figure for that degradation.

Desktop Manager. I first encountered a virtual screen program like this under HP/UX, and have used similar programs under Irix, Linux, and Windows. This is a particularly nice one, at least in terms of eye candy. Seems stable, and is great for a machine that’s used for development, web surfing, image editing, etc. to keep each activity kinda separate.

Wed, 29 Jun 2005

Organizing Digital Photography

— SjG @ 9:20 pm

Well, it’s an impossible problem. My digital cameras all have high-speed “spray-and-pray” modes, which are the only reasonable response to the challenge of taking candid pictures of children. One shoots a buffer full of pictures, and in one of them (if one’s lucky), all of the kids will have their eyes open, there will be no fingers stuck up noses, and, if one’s really lucky, there will be nice expressions on all of the visible faces.

But the downside is the proliferation of pictures. One develops a certain Tommygun mentality, and, hey, disk space is cheap. Composition’s easier in Photoshop than through the viewfinder.

In short, I have a digital picture management problem. Apple’s iPhoto is a good start, but it can’t handle the quantities of images I’m throwing at it. Recently, I’ve been using an evaluation version of iView Multimedia’s iView Pro. It seems good, with lots of options and configurability. I’d rather not spend $200, but if I can learn to use it adequately, it’d be worth it. And I certainly don’t have time to write my own (witness the moribund Samuel’s Last Attempted Gallery [SLAG] web application that’s never made it past the schema design phase).

I’ll report here eventually what I find.

Fri, 20 May 2005

Treo Sync Followup, part 2

— SjG @ 3:23 pm

Well, I can now state authoritatively that the problem was with Mac OS. I still don’t know what went wrong, or why, since I was originally able to sync a few times before it stopped working.

In any case, I upgraded the notebook to Mac OS 10.4 (“Tiger”), and lo and behold! sync worked with the cable right off the bat. And damn is the USB sync cable faster than bluetooth.

So if you’re having problems synching on a Mac, this might be a starting point for diagnosing the problem.