1

这让我发疯,遵循所有在线教程并没有帮助。

我刚刚升级到运行 MacOS Sierra (10.12.1) 的新 mac,并正在尝试配置我的开发环境。但是,每当我在我的项目上运行 composer update 或 composer install 时,我都会收到以下消息:

PHP Warning:  PHP Startup: Unable to load dynamic library '/usr/lib/php/extensions/no-debug-non-zts-20131226/mcrypt.so' - dlopen(/usr/lib/php/extensions/no-debug-non-zts-20131226/mcrypt.so, 9): image not found in Unknown on line 0
Loading composer repositories with package information
Installing dependencies (including require-dev) from lock file
Your requirements could not be resolved to an installable set of packages.

  Problem 1
    - Installation request for laravel/framework v5.0.35 -> satisfiable by laravel/framework[v5.0.35].
    - laravel/framework v5.0.35 requires ext-mcrypt * -> the requested PHP extension mcrypt is missing from your system.
  Problem 2
    - laravel/framework v5.0.35 requires ext-mcrypt * -> the requested PHP extension mcrypt is missing from your system.
    - tom-lingham/searchy 2.0.10 requires illuminate/support 5.* -> satisfiable by laravel/framework[v5.0.35].
    - Installation request for tom-lingham/searchy 2.0.10 -> satisfiable by tom-lingham/searchy[2.0.10].

  To enable extensions, verify that they are enabled in those .ini files:
    - /etc/php.ini

我已经运行了 brew install mcrypt 并且它已经安装了。

Warning: mcrypt-2.6.8 already installed

系统正在运行 php 7.1,所以我也运行了 brew install php71-mcrypt

extension=mcrypt.so 已包含在 php.ini 文件中,在我的机器上和我在 vagrant 机器上都试过了。

任何帮助将不胜感激,因为我已经在这 2 天了!

4

1 回答 1

1

由于您正在运行 vagrant,因此您需要在 vagrant 机器中安装 mcrypt。检查您在 vagrant 上安装了哪个版本的 php 并使用安装 mcrypt

sudo apt-get install *{mcrypt-version-here}*

使用重启apache

sudo service apache2 restart
于 2016-12-10T12:02:34.620 回答