If PHP 4 and 5 are installed in different paths, or with different binary names ('php5' or 'php5-cli' perhaps?), ensure that you're running the PHP 5 version.
Thanks Brion, that was indeed the problem: Two versions of PHP on the server. I found the path to PHP5 and now the script is running.
Mike O
wikitech-l@lists.wikimedia.org