Space Cat, Prince Among Thieves

Install PHP Mcrypt Extension in OS X

This is verified to work in Yosemite but should work at least in Mavericks if not older as well. Let me know if issues should arise.

These directions are for working with the native installation of PHP. Your results may vary if you are using a brew or otherwise installed version of PHP.

We meed install the required dependencies. If you are not already using Homebrew you will need it.

$ brew install autoconf pkg-config libmcrypt

You will also want to make sure you have PEAR installed; instructions can be found here but can be summarized as follows:

$ wget
$ php go-pear.phar

Next we will download the PHP source. Verify the exact version of PHP you are running.

$ php --version

This should output something along the lines of the following. The version is highlighted.

PHP 5.5.14 (cli) (built: Sep  9 2014 19:09:25) 
Copyright (c) 1997-2014 The PHP Group

Now we move into a working directory and download the source making sure to update the following for the version from above.

$ cd /tmp
$ mkdir memcached
$ curl -L{{version}}.tar.bz2/from/this/mirror > php.tar.bz2
$ open php.tar.bz2

Now we will compile and test the Mcrypt extension.

$ cd php-{{version}}/ext/mcrypt
$ phpize
$ ./configure
$ make
$ make test
$ sudo make install

If all that goes well finally we'll need to add the following to our php.ini - I usually add at it at the end of the file.

extension =

You can verify your installation with the following:

$ php --info | grep mcrypt\\.

Lastly, depending on your setup now you may want to restart apache.

$ sudo apachectl restart

Read More / Comment »

Require a Remote Zip File with Composer

I previously showed you how to Load a Github Gist with Composer, but sometimes you need to install code that isn't isn't even in a public facing VCS. I for instance wanted to use a library only distributed by Zip. It's actually fairly easy! In your composer.json file, you simply add a repositories s…

Read More / Comment »

All Glory to __invoke

Lost in the shiny new features (see: namespaces and closures) PHP 5.3 also added the __invoke method. While not plainly apparent, it is secretly an amazingly useful 'magic method' . If you're not taking advantage of __invoke, you should be. Why? It provides a uniform execution points for objects th…

Read More / Comment » donatJ

Fleet Foxes - Fleet Foxes
Gorillaz - Plastic Beach
Fleet Foxes - Helplessness Blues
The Wallflowers - Bringing Down The Horse
Fleet Foxes - Sun Giant [EP]
Arca - Xen
The Weepies - Sirens
Fischerspooner - #1
The Velvet Underground - The Velvet Underground & Nico

Flickr donatJ


Recent Comments

Just a suggestion here, I dont know if someone said it before. It would be nice to be able to click and color the blocks so we know what we have built yet.

I suppose the creator of CoffeeScript counted that the developers using it know the difference between an object and a function. y = 0 test = (x) -> @y =…

Brilliant! Hats off to you, sir!

This is so great! Thanks so much! You just saved me a bazillion hours of manual coding!

This tool is the dogs! thanks for creating :)

Tag Cloud