问题
I am trying to migrate laravel app into ubuntu and getting error like Mcrypt PHP extension required. when i check php details with phpinfo() function it showing below screen.

PLlease find the Terminal Screenshot below,

php.ini

回答1:
If you have installed PHP through apt-get
then find the mcrypt extension you are using either for apache by using
$ locate *mcrypt.ini
/etc/php5/apache2/conf.d/20-mcrypt.ini
/etc/php5/cli/conf.d/20-mcrypt.ini
/etc/php5/fpm/conf.d/20-mcrypt.ini
/etc/php5/mods-available/mcrypt.ini
/usr/share/php5/mcrypt/mcrypt.ini
/var/lib/ucf/cache/:etc:php5:mods-available:mcrypt.ini
go into the directory that you have your extension in
cd /etc/php5/apache2/conf.d/20-mcrypt.ini
and you will probably find there is a symlink to the mcrypt extension in the mods-available directory. If that's the case all you have to do is cd into the /etc/php5/cli/conf.d
directory
and create a similar symlink
cd /etc/php5/cli/conf.d
sudo ln -s ../../mods-available/mcrypt.ini ./
then restart php maybe with sudo service php5 restart
That should work
回答2:
Find mcrypt.ini
file in /etc/php5/mods-available/mcrypt.ini
,if this file does not exist,means php5-mcrypt could create the file.
- create the file
mcrypt.ini
in dir/etc/php5/mods-available/
And add the following config to it:
extension=mcrypt.so
Run this commands
sudo php5enmod mcrypt
sudo service php5-fpm restart
This worked for me.Cheers
来源:https://stackoverflow.com/questions/28230327/mcrypt-php-extension-required-in-laravel-with-ubuntu-14