Error: Mcrypt required in Laravel 4

9

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

  

Mcrypt PHP extension required

How do I solve this problem?

    
asked by anonymous 07.01.2014 / 19:48

3 answers

7

You should install the mcrypt extension, which is not usually included with PHP.

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

Debian / Ubuntu :

  

apt-get install php5-mcrypt

OS X via HomeBrew :

  

brew install php55-mcrypt

Windows :

extension should not be active, uncomment line

  

; php_mcrypt.dll

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

  

php_mcrypt.dll

Then restart your server!

    
07.01.2014 / 19:54
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 
    
08.01.2014 / 02:53
0

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

    
22.01.2014 / 02:42