I am trying to use the migrate
function in Laravel 4
on OSX
. However, I am getting the following error:
Laravel requir
To those that uses XAMPP 1.7.3 and Mac
which php
/usr/bin/php
, then proceed to 3.sudo nano ~/.bash_profile
(or sudo vim ~/.bash_profile
if you know how to use it)export PATH="/Applications/XAMPP/xamppfiles/bin:$PATH"
cd ~
. .bash_profile
which php
. If you did it right, it should be the same as the path in #4.The reason for the mcrypt error is because your Mac uses its native php, you need to change it to the one xampp has.
P.S. I'd recommend using MAMP for Laravel 4 for Mac users, this issue will get resolved along with the php file info error without a sweat, and the php version of xampp is so outdated.
in ubuntu 14.04 based on your php version : 5.6,7.0,7.1,7.2,7.3
sudo apt-get install php{version}-mcrypt
sudo apt-get install php7.1-mcrypt
sudo phpenmod mcrypt
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
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
sudo rm /etc/php5/mods-available/mcrypt.ini
sudo apt-get purge php5-mcrypt
sudo apt-get install mcrypt
sudo apt-get install php5-mcrypt
sudo php5enmod mcrypt
fixing the browser error
(if you are having mcrypt error in browser when accessing local laravel index page)
sudo nano /etc/php5/apache2/php.ini
add the following line under the dynamically compiled extensions section of php ini
extension=mcrypt.so
restart the apache server , purge the laravel cache and everything working
If you are using Z Shell, just do the following:
nano ~/.zshrc
export PATH=/Applications/MAMP/bin/php/php5.6.10/bin:$PATH
source ~/.zshrc
which php
- you should get the MAMP 5.6.10 path5.6.10 is the version of PHP you set in your MAMP.
For non MAMP or XAMPP users on OSX (with homebrew installed):
brew install homebrew/php/php56-mcrypt
Cheers!