Nov 26 2013

Howto: Disable Mcrypt in Laravel

Some of the order installations or embedded (ARM processor) builds of PHP may not have PHP Mcrypt module pre-compiled and available. For example Synology entry-level NASes have ARM processors as does my Synology DS-413j. I tried to install Mcrypt via ipkg but it is not available. I tried to compile it from the sources but was not successfull.

Some PHP frameworks, like Laravel and Magento require Mcrypt. Mcrypt is an encryption tool that uses modern algorithms. Laravel uses Mcrypt for encryption and hash generation. If you are using Laravel as a pure template engine as I do, you do not need PHP Mcrypt module.

Fortunately Mcrypt is easy to disable in Laravel. Locate the file: /vendor/laravel/framework/src/Illuminate/Foundation/start.php. Comment the following segment:

if ( ! extension_loaded('mcrypt')) {
  die('Laravel requires the Mcrypt PHP extension.'.PHP_EOL);

That’s it, enjoy.

Leave a Reply