使用MAMP运行Composer:无法加载动态库mcrypt.so

时间:2015-05-27 16:53:24

标签: php composer-php mamp mcrypt

我正在尝试让作曲家在我的Mac上运行并使用MAMP。我使用

安装了composer
sudo curl -sS https://getcomposer.org/installer | phpmamp

所以,在.bash_profile中,我添加了以下别名

alias phpmamp='/Applications/MAMP/bin/php/php5.5.14/bin/php'

安装完成后,我还将composer.phar移动到/ usr / local / bin / composer

现在我尝试运行composer,我收到以下错误:

PHP Warning:  PHP Startup: Unable to load dynamic library '/usr/local/Cellar/php53-mcrypt/5.3.26/mcrypt.so' - dlopen(/usr/local/Cellar/php53-mcrypt/5.3.26/mcrypt.so, 9): Library not loaded: /usr/local/lib/libmcrypt.4.4.8.dylib
  Referenced from: /usr/local/Cellar/php53-mcrypt/5.3.26/mcrypt.so
  Reason: image not found in Unknown on line 0

Warning: PHP Startup: Unable to load dynamic library '/usr/local/Cellar/php53-mcrypt/5.3.26/mcrypt.so' - dlopen(/usr/local/Cellar/php53-mcrypt/5.3.26/mcrypt.so, 9): Library not loaded: /usr/local/lib/libmcrypt.4.4.8.dylib
  Referenced from: /usr/local/Cellar/php53-mcrypt/5.3.26/mcrypt.so
  Reason: image not found in Unknown on line 0
??+?%

这是我的php版本信息:

PHP 5.5.14 (cli) (built: Jul 25 2014 17:02:08)
Copyright (c) 1997-2014 The PHP Group
Zend Engine v2.5.0, Copyright (c) 1998-2014 Zend Technologies

我尝试将以下内容添加到我的bash_profile中,没有运气/差异:

PATH=/Applications/MAMP/bin/php/php5.5.17/bin:$PATH

1 个答案:

答案 0 :(得分:0)

您正在尝试将PHP 5.3库加载到PHP 5.5安装中。您需要安装PHP 5.5版本的mcrypt。如果你使用Homebrew管理你的PHP安装(你应该这样做),${param.nextItem.name} 就可以了。