First, it is necessary to install the Mcrypt
Ubuntu / Debian:
sudo apt-get install php53-mcrypt ou php54-mcrypt
Go to file php.ini
uncomment% lib php_mcrypt.so
On OSX: (and need to have homebrew installed)
brew install php53-mcrypt ou php54-mcrypt
Note: If it does not find the package, homebrew looks for an alternative and shows if it finds a repository to download. Simply add the repository or simply write the way it was passed in brew install which it should install right. Also it may need to install to zlib that does not have in the repository when trying to install by brew but it will inform a repository that can be used.
Homebrew may not install for lack of other libraries that need to be added to the part, just search google for brew and the library name.
After installing go to:
cd /private/etc
sudo mv php.ini.default php.ini
sudo {editor de preferencia} php.ini
Inside the file add in extensions:
extension="/usr/local/Cellar/php53-mcrypt/5.3.28/mcrypt.so"
Modify the version as needed, and restart apache
sudo apachectl restart
In Windows, it will depend on whether you are using some bundle like wamp. In this I need to define the libraries that should be active for php.
Maybe this link will help you set up for wamp:
configure wamp for mcrypt
and wikihow