Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I install mcrypt under PHP7? Laravel needs it

Since Laravel4 requires mcrypt extension, and PHP7 doesn't seem to have mcrypt extension, is there any workaround for this to work?

like image 304
Bishal Paudel Avatar asked Dec 04 '15 07:12

Bishal Paudel


People also ask

Does laravel require mcrypt?

Laravel does not need mcrypt extension anymore. The best (=secure) solution is to update to Laravel >5.1 (there is no LTS before Laravel 5.2).

How do I enable PHP mcrypt?

You can install Mcrypt from the PHP Source Tree as a module if you choose. Enable the module by adding: 'extension=mcrypt.so' to PHP. ini. Done!

What is mcrypt PHP extension required?

What is mcrypt? The mcrypt extension is a replacement for the UNIX crypt command. These commands serve as a means to encrypt files on UNIX and Linux systems. The php-mcrypt extension serves as an interface between PHP and mcrypt.


2 Answers

Had the same issue - PHP7 missing mcrypt.

This worked for me. When asked, keep local PHP configuration files.

sudo apt-get update sudo apt-get install mcrypt php7.0-mcrypt sudo apt-get upgrade 

Restart FPM (or Apache or NGINX etc.) after installation.

like image 199
Ryderpro Avatar answered Sep 21 '22 07:09

Ryderpro


I'm on Mac and with laravel valet I've solved with this:

brew install php70-mcrypt

like image 26
carlituxman Avatar answered Sep 22 '22 07:09

carlituxman