Mcrypt PHP extension required.IN Laravel With Ubuntu 14

一个人想着一个人 提交于 2020-01-25 02:57:08

问题


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

How to solve this issue ?

回答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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!