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 http://pear.php.net/go-pear.phar
$ 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 http://php.net/get/php-{{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 = mcrypt.so

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 »

Last.fm donatJ

Philip Glass - Mishima
Arca - Xen
CHVRCHES - The Bones of What You Believe
Andrew Hewitt - The Double (Original Soundtrack Album)
Kanye West - The College Dropout
Tycho - Awake
Agnes Obel - Aventine
Kyu Sakamoto - The Double (Original Soundtrack Album)
Bob Dylan - Blonde on Blonde

Flickr donatJ

STP80617
STP80616
STP81015
STP81006
STP81005
STP81004
STP80967
STP80961

Recent Comments

Yeah i tried, all the urls have the http protocol, but i can´t copy the exact url cause the comments doesn´t accept urls.
Link

I made a really big thing out of circles.
Link

Have you tried adding http://? The links will be processed a little differently when it realizes these are full url's and not relative paths.
Link

Hi, i´m trying to redirect two kinds of urls but any of them works. Examples: 1: www.asdasd.com/anuncios/buscar/1/?cat=190&buscar_anuncio=Buscar www.asdasd…
Link

Can u reference me to a STAR generator? I'm trying to make Hammer Kirby, and I keep srewing up the star, help plz!?
Link

Tag Cloud