I am trying to use the migrate
function in Laravel 4
on OSX
. However, I am getting the following error:
Laravel requires the Mcrypt PHP extension.
As far as I understand, it's already enabled (see the image below).
What is wrong, and how can I fix it?
in ubuntu 14.04 based on your php version : 5.6,7.0,7.1,7.2,7.3
OSX with brew
I am running PHP 7.0.x, so change "php70" to your version, if you are using a different version.
As stated in other answers, you can see your php version with
$ php -v
.My OS is
Yosemite
.I resolve this issue, by finding configuration paths:
Example output:
Next steps:
Commands:
Then you can check your php modules via:
For php-fpm installations on Ubuntu 14.04, the following worked for me :
sudo apt-get install php5-mcrypt
This will create
mcrypt.ini
file inside/etc/php5/mods-available/
Then
sudo php5enmod mcrypt
will create a symlink in:
/etc/php5/fpm/conf.d/
Just restart php-fpm services
sudo service php5-fpm restart
For ubuntu try these steps if others are not working :
cd ~
sudo apt-get remove php5-mcrypt
sudo apt-get install php5-mcrypt
sudo php5enmod mcrypt
sudo service apache2 restart
Hope that will help. Thanks !
Getting Laravel working on Apache
PHP version : PHP 5.5.9
Ubuntu version : 14.04
i had a working laravel project on windows. when i copied it to ubuntu server , i started getting the mcrypt error. this after a lot of hours of trial and error
getting artisan command working
(if you are having mcrypt error while using artisan command line tool)
i did a lot of trial and error so each time i run the php5enmod command before, i had error messages. but on fresh install there was no error messages. after this step i got artisan command working
fixing the browser error
(if you are having mcrypt error in browser when accessing local laravel index page)
add the following line under the dynamically compiled extensions section of php ini
restart the apache server , purge the laravel cache and everything working