简体   繁体   中英

ext-mcrypt error while installing laravel on ubuntu 14.04

I am beginner in laravel in ubuntu 14.04. I try to run this following commend for install laravel.

composer create-project laravel/laravel --prefer-dist

and i got following error. i am also try to install ncrypt but i got same error.

Installing laravel/laravel (v5.0.1)
      - Installing laravel/laravel (v5.0.1)
        Loading from cache

    Created project in /opt/lampp/htdocs/laravel
    Loading composer repositories with package information
    Installing dependencies (including require-dev)
    Your requirements could not be resolved to an installable set of packages.

      Problem 1
        - laravel/framework v5.0.2 requires ext-mcrypt * -> the requested PHP extension mcrypt is missing from your system.
        - laravel/framework v5.0.1 requires ext-mcrypt * -> the requested PHP extension mcrypt is missing from your system.
        - laravel/framework v5.0.0 requires ext-mcrypt * -> the requested PHP extension mcrypt is missing from your system.
        - Installation request for laravel/framework 5.0.* -> satisfiable by laravel/framework[v5.0.0, v5.0.1, v5.0.2].

i am also try to run this command but i got this same error.

sudo apt-get install mcrypt php5-mcrypt
sudo php5enmod mcrypt
sudo service apache2 restart

Thanks in advance..

I am open this file

gedit /etc/php5/cli/php.ini

put one line in to this file

extension=mcrypt.so

and this run successfully.

any ways thanks again.

This is how I solved on Mac Yosemite. I have one php.ini in /etc/, and I have mcrypt instaIled. But I faced the same problem.

Run this to find another php.ini.

php -i|grep ini

It returned the followings.

System => Darwin Myname-MacBook-Pro.local 14.1.0 Darwin Kernel Version 14.1.0: Mon Dec 22 23:10:38 PST 2014; root:xnu-2782.10.72~2/RELEASE_X86_64 x86_64
Configuration File (php.ini) Path => /usr/local/etc/php/5.5
Loaded Configuration File => /usr/local/etc/php/5.5/php.ini
....

I open /usr/local/etc/php/5.5/php.ini and added extension=mcrypt.so to the file.

I hope this will help someone in future.

Mac users with brew just run in CLI:

brew install php56-mcrypt

Doinion Rings.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM