Mac OS X El Capitan

时间:2015-11-02 18:17:22

标签: php macos laravel mcrypt

在Mac OS X El Capitan中使用Mcrypt PHP extension required.获取错误Laravel

已使用brew安装了mcrypt。

brew install mcrypt
brew install homebrew/php/php55-mcrypt
sudo apachectl restart

哪个php

/usr/local/bin/php

php --version

PHP 5.5.30 (cli) (built: Oct  3 2015 23:48:03) 
Copyright (c) 1997-2015 The PHP Group
Zend Engine v2.5.0, Copyright (c) 1998-2015 Zend Technologies

php --ini

Configuration File (php.ini) Path: /usr/local/etc/php/5.5
Loaded Configuration File:         /usr/local/etc/php/5.5/php.ini
Scan for additional .ini files in: /usr/local/etc/php/5.5/conf.d
Additional .ini files parsed:      /usr/local/etc/php/5.5/conf.d/ext-mcrypt.ini

2 个答案:

答案 0 :(得分:2)

Yu最重命名原来的libphp:

sudo mv /usr/libexec/apache2/libphp5.so /usr/libexec/apache2/libphp5.so.origin

并链接新的自制php lib安装

sudo ln -s /usr/local/Cellar/php55/5.5.29/libexec/apache2/libphp5.so  /usr/libexec/apache2/libphp5.so

然后重启apachectl

sudo apachectl restart

对我有用

答案 1 :(得分:0)

我认为这就是你要找的东西:

http://phpbrew.github.io/phpbrew/

它允许您构建任意数量的PHP版本,在它们之间切换并设置默认值。添加和删​​除扩展程序等。

祝你好运!