Installing PEAR 1.9.2 with MAMP and PHP 5.3 on Mac OSX 10.6

Installing Pear 1.9.2 with MAMP

Installing PEAR 1.9.2 with MAMP 1.9.1 and PHP 5.3.2 on Mac OSX 10.6

This was a lot harder than I think it should have been. I tried following the instructions on the following sites but despite saying that there was “nothing to upgrade” it was still saying version 1.9.0.

http://serverfault.com/questions/184741/upgrading-pear-from-1-9-0-to-1-9-1-fails
http://startrekguide.com/community/viewtopic.php?f=50&t=14728
http://jamsyoung.com/2011/02/11/upgrading-pear-on-mamp/

Using the “go-pear.php” method resulted in the following error:

"Sorry! Your PHP version is too new (5.3.2) for this go-pear."

and using the “pear upgrade pear” method resulted in

"Download of "pear/Console_Getopt" succeeded, but it is not a valid package archive".

At one point I also got the amusing error message saying that it couldn’t upgrade to 1.9.1 because pear/Console_Getopt needed version 1.9.1 to install.

Finally (after installing it in the wrong place twice) I found this method which did work:

Installing Pear 1.9.2

1) Open a new terminal session.

2) Edit your .bash_profile:


edit ~/.bash_profile

so that it contains the following (add it under anything you already have).


PATH="/Applications/MAMP/Library/bin:/Applications/MAMP/bin/php5.3/bin:$PATH"

3) Close terminal and re-open it then type

echo $PATH

It should contain the new MAMP paths. If it doesn’t, something went wrong (make sure you’re in your home directory).

4) Check that you’re running the right PHP (i.e. the one included with MAMP, not the one included in OSX) by typing:

which php

It should read:

/Applications/MAMP/bin/php5.3/bin/php

5) If it says

/usr/bin/php

then you need to either create a symlink to the MAMP version or delete it from here and update your path in your .bash_profile (see above — remember to restart terminal to start a new session).

I backed up the original Snow Leopard versions of PHP and Pear and then deleted them by doing the following:

cd /usr/bin
sudo cp php php.bak
sudo cp pear pear.bak
sudo rm php
sudo rm pear

6) Download pear.php.net/go-pear.phar to /Applications/MAMP/bin/php5.3/:

cd /Applications/MAMP/bin/php5.3
curl -O http://pear.php.net/go-pear.phar
php go-pear.phar

7) You’ll be asked to set the directories. You only need to set the first one and the rest will be correctly created. Choose “1″ and then type:

/Applications/MAMP/bin/php5.3

Hit return.

8) It will then ask you if you want to update your php.ini. Type “Y” and hit enter.

Once it’s all installed, you’ll see a message saying that you have to update your $PATH variable. If you haven’t already (see step 1), do this now then restart Terminal.

9) Type pear -V and it should now be 1.9.2.

You can then install all the packages you like. Remember that PHPUnit is now on its own channel and you’ll have to make pear aware of that new channel by running

pear channel-discover pear.phpunit.de

Create a Quick Grassy Hill in Illustrator with the Crystallize Tool

Quick Grassy Hill in Illustrator

Illustrator offers some very powerful tools for doing damage to your designs. In this tutorial, I want to show you how to quickly create a grassy hill using the Crystallize tool.

1) Start with a new document (Cmd/Ctrl + N), and give it a name. In a fit of originality, I called mine ‘Quick Grassy Hill’. Set the dimensions to 600px wide and 400px high.

Set Up Illustrator

Continue reading

Optimize Your WordPress Database

Optimizing Your Wordpress Database

WordPress is an amazing publishing platform. Part of its greatness is how user friendly it is, with Revisions being a particular case in point. I can’t count the number of times that I’ve had to load up a previous version of a post to reclaim some literary nugget that I accidentally deleted in a fit of writer’s angst.

Unfortunately, in order to save me from myself, it has to use quite a lot of database space. Each revision means one more row in the Posts table, on top of the canonical version that you create every time you hit the Update or Draft versions. If you are like me and painfully obsessive about every single word, or you write epic 5,000 word posts, then that one post could have 20 or 30 revisions saved in addition to your working copy.

Multiply that by the number of posts on your blog, and it could quickly run up to the hundreds or thousands of rows.

Continue reading

Creating a 3D Pipe with Illustrator and Photoshop

Illustrator 3D Objects

We’ll be building the shape in Illustrator using the 3D Revolve tool before going into Photoshop to texture it all up using clipping masks and blend modes and layer styles and all that modern doohickory.

Continue reading

How To Upgrade To WordPress 3 Safely

Header image for the Upgrade to Wordpress 3 post

The recent release of the world’s most popular blogging platform has seen some huge additions, including the ability to add custom Post Types and custom Taxonomies, and support for multiple blogs.

Other improvements include support for custom stylesheets to style the post and page editors. What this means is that what you see in the editor more closely resembles the final product.

To take advantage of these amazing new features, you’ll need to upgrade. Upgrading your current version of WordPress to the new version is pretty easy and all of the core functionality should just continue to work as normal and you shouldn’t lose anything.

However, there have been reports of bugs in some plugins and themes after the new version has been installed, so some care should be taken.

Continue reading