Error: Mcrypt required in Laravel 4

Asked

Viewed 995 times

9

I made a new installation of Laravel 4. I have all the requirements of the system are correct. However, when I try to use the artisan to rotate the command key:generate, to configure my APP, I can’t. Returns me the following error:

Mcrypt PHP Extension required

How to solve this problem?

3 answers

7


You must install the mcrypt extension, which is normally not included with PHP.

I do not know which operating system, here dry the model for some, if you help stating which is the system, I can be more specific:

Debian/Ubuntu:

apt-get install php5-mcrypt

OS X via Homebrew:

Brew install php55-mcrypt

Windows:

the extension must not be active, uncompromising the line

;php_mcrypt.dll

in his php.ini removing the ; from the beginning, thus leaving:

php_mcrypt.dll

Then restart your server!

  • Ubuntu: sudo apt-get install php5-mcrypt. Fixed the problem.

  • 1

    you can mark the answer as correct then...

0

Debian/Ubuntu

//Cria um link para mods-available    
sudo ln -s /etc/php5/conf.d/mcrypt.ini /etc/php5/mods-available

//Habilita o mcrypt
sudo php5enmod mcrypt 
//Reinicia o apache
sudo service apache2 restart 

0

First, it is necessary to perform the library installation Mcrypt Ubuntu/Debian:

sudo apt-get install php53-mcrypt ou php54-mcrypt

Go to the archive php.ini decrypt the lib php_mcrypt.so

In the OSX: (and I need to have the 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 that it should install right. Also maybe it needs to install to zlib that it does not have in the repository when trying to install from 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 google for Brew and the library name. After installing should go on:

cd /private/etc
sudo mv php.ini.default php.ini
sudo {editor de preferencia} php.ini

Inside add file 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 a Bundle like wamp. In this one I need to define which libraries should be active for php.

Maybe this link will help you set up for wamp: wamp setup for mcrypt and wikihow

Browser other questions tagged

You are not signed in. Login or sign up in order to post.