Note – this assumes you are running MAMP on a Mac. For this I’m using Leopard 10.5.8.
All you want to do is get this installed so you can have fancy upload bars in your Drupal 7 installation. So you follow the instructions and only get a bunch of errors. Maybe you see stuff like this:
make: *** [uploadprogress.lo] Error 1
And toward the top of your “make” you see stuff like this:
error: php.h: No such file or directory
I was seriously stumped. I knew this was probably related to having both the default version of PHP that comes with OS X enabled, as well as the MAMP version – but it’s the same stuff, right? Nope – MAMP does not come with everything needed to compile a PECL installation, at least not with my setup (MAMP version 1.7.2 running PHP 5.2.x).
So what you have to whip out the command line and specifically setup your installation environment by explicitly declaring which PHP environment to use. So fire up your Terminal!
OK – MAMP does come with the phpize command, but it’ll setup the wrong environment for our needs. So head into the uploadprogress directory that your downloaded and untarred, and run:
sudo make install
If all went well, you should have no errors, and you’ll have some output telling you the extension directory it placed uploadprogress.so in.
You’ll need to open up MAMP’s php.ini file and make some changes now. For me, this is in MAMP/conf/php5
Around line 428 – you’ll need to put something like this in:
extension_dir = "(insert the outputted extension directory from after you ran the make install command)"
(If you’re like me and already had this setup from installing xdebug, then you’ll need to just move the uploadprogress.so file into the defined directory.)
Now we need to tell php to load this extension. Around line 540 or so, add this:
Now restart MAMP, and you should be all loaded up! If you head over to your Drupal status report, you should see PECL is now installed (image below, my frickin’ badge of honor). Boy, hopefully this is easier on the production server!
Later that day…
So looks like now that this is up and running, I’ve discovered that Drupal 7.0 has a bug that prevents the progress bar from showing. Hopefully we’ll get this fixed in 7.1.
Later later that day…
This was actually much easier on my Red Hat production server, the commands were pretty much the same. Here it is working with Drupal 6.20: