can't create a Laravel project because mcrypt extension is missing

南笙酒味 提交于 2019-12-04 06:29:11

I got this exact same problem too. You have to find php.ini for php cli and add extension=mcrypt.so

My system is running LAMPP server with preinstalled PHP. So, here's what I do:

Install mcrypt extension

I tried both:

sudo apt-get install mcrypt
sudo apt-get install php5-mcrypt

Configure php.ini for CLI

Then, edit php.ini located in /opt/lampp/etc/php5/cli/php.ini add extension=mcrypt.so on Dynamic Extension section (anywhere is fine I think). Don't forget to restart your server.

Try using composer to install laravel

Now, you can run whatever method you want to install laravel. I download Laravel 5 manually, unzip, then install using composer install command. I think your command composer create-project laravel/laravel projectname would've run smoothly too.

References: here

mac users install brew and then enter

brew install php56-mcrypt

in terminal

EDIT

if you get any error using above line then try this command

brew install homebrew/php/php56-mcrypt
sam

Please following the step :

  1. cd /etc/php5/cli/conf.d
  2. ln -s ../../mods-available/mcrypt.ini 20-mcrypt.ini

Worked for me.

For MAC users,

brew install homebrew/php/php56-mcrypt

I also couldn't get it to work this way after numerous trials. So, I tried the alternate way.

composer global require "laravel/installer=~1.1"

laravel new projectname

This was successful.

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