Use of undefined constant MCRYPT_RIJNDAEL_128 - assumed 'MCRYPT_RIJNDAEL_128' Use of undefined constant MCRYPT_RIJNDAEL_128 - assumed 'MCRYPT_RIJNDAEL_128' laravel laravel

Use of undefined constant MCRYPT_RIJNDAEL_128 - assumed 'MCRYPT_RIJNDAEL_128'


More simple way on ubuntu

  • apt-get install php5-mcrypt
  • mv -i /etc/php5/conf.d/mcrypt.ini /etc/php5/mods-available/
  • php5enmod mcrypt
  • service apache2 restart

Note: if you don't have "/etc/php5/conf.d" just skip that step and it will work ok

check http://php.net/manual/en/mcrypt.installation.php


This problem relative to the PHP extensions loader.You no need to use laravel command at all after successful installation.Laravel framework need Mcrypt Library for the security module and encrypt some of configure file.

The things that you need is theses steps.

  1. Download Mcrypt http://sourceforge.net/projects/mcrypt/files/Libmcrypt/2.5.8/libmcrypt-2.5.8.tar.gz/download

then configure make and install it.

  1. Download php http://php.net/releases/index.php Above 5.5.14 are suggested. (Use this path later on step 4)

  2. then download Autoconfigure

    curl -O http://ftp.gnu.org/gnu/autoconf/autoconf-latest.tar.gztar xvfz autoconf-latest.tar.gzcd autoconf-2.69/./configuremakesudo make install
  3. then you have to go to directory level

    cd ***YOURPHPDIRECTORY***/ext/mcrypt/

    and run phpize within this directory level

    /usr/bin/phpize./configuremakesudo make install
  4. modify your php.ini to enable the mcrypt extension by insert this into php.ini

    extension=mcrypt.so
  5. Restart web server.


For Mac users's specially - install it using Home Brew

I’ve installed an empty Laravel installation and got the following error message when navigating to http://localhost/kanban/public/:

Notice: Use of undefined constant MCRYPT_RIJNDAEL_128 – assumed ‘MCRYPT_RIJNDAEL_128′ in /Library/WebServer/Documents/xxx/config/app.php on line 83

Googling for this error message return many tutorials on how to install mcrypt on Mac OS X (whether building it from source or using Homebrew). The problem was that both the mcrypt and the php55-mcrypt packages were properly installed:

$ brew install mcryptWarning: mcrypt-2.6.8 already installed$ brew install php55-mcryptWarning: php55-mcrypt-5.5.20 already installed

Mcrypt was also properly loaded by PHP:

$ php -m | grep mcryptmcrypt$ php -i | grep mcryptAdditional .ini files parsed => /usr/local/etc/php/5.5/conf.d/ext-mcrypt.ini,Registered Stream Filters => zlib.*, bzip2.*, convert.iconv.*, string.rot13, string.toupper, string.tolower, string.strip_tags, convert.*, consumed, dechunk, mcrypt.*, mdecrypt.*mcryptmcrypt support => enabledmcrypt_filter support => enabledmcrypt.algorithms_dir => no value => no valuemcrypt.modes_dir => no value => no value

for more details refer this link - http://benohead.com/mac-os-x-php-notice-use-undefined-constant-mcrypt_rijndael_128/