有人遇到同样的问题吗? 谢谢提前。
干杯
我刚刚使用Homebrew在我的Mavericks安装上安装了它,效果出乎意料的好。无法确定它是否在Yosemite上能够如此顺利地运行,但值得一试。
brew install autoconf
brew install mcrypt
Check PHP version
php -v
Update Macports
sudo port -v selfupdate
Download & install the appropriate version..
sudo port install php55-mcrypt
now dummy proof it..
Find where Macports put the file mcrypt.so and copy it to all instances of /php/extensions/no-debug-...
folder. If you have that directory structure in multiple places, copy it to all of them. So every php/extensions/no-debug.. folder on your computer has a copy of mcrypt.so
sudo cp /opt/local/lib/php/extensions/no-debug-non-zts-20090626/mcrypt.so /usr/lib/php/extensions/no-debug-non-zts-20090626/
Determine where your php.ini file is and make sure it's the one your actually using because you may have this file in more than 1 place. Do this to all php.ini
files you find..
Within that file find and uncomment the following line. If it's commented out, uncomment it. If it's not in the file at all, add it. In my default php.ini file I found this on line 536:
extension=mcrypt.so
Download mcrypt
curl -O http://downloads.sourceforge.net/project/mcrypt/Libmcrypt/2.5.8/libmcrypt-2.5.8.tar.gz
Uncompress it
tar -zxvf libmcrypt-2.5.8.tar.gz
Configure, build, and install
./configure && make && sudo make install
Download Autoconf
curl -O http://ftp.gnu.org/gnu/autoconf/autoconf-latest.tar.gz
Uncompress it
tar xvfz autoconf-latest.tar.gz
Configure, build, and install
./configure && make && sudo make install
无论你使用哪种方法安装它,完成后都应该重新启动Apache。
Restart Apache
sudo apachectl restart
我刚刚安装了这些插件,MAMP等并没有被安装。
brew tap josegonzalez/homebrew-php
brew install php55-mcrypt
奇怪的是,我不得不重新安装才能正确安装它。
brew reinstall php55-mcrypt
然而,这也重新安装了PHP5.5源代码,但是没关系,我这边一切都正常工作。
首先从homebrew安装libtool,它是10.10 Yosemite的一个依赖项。
brew reinstall libtool --universal && brew unlink libtool && brew link libtool
cd /usr/local/php5
并将其放入您的php.d目录中
cd php.d
最后,快速执行 ls 命令查看您正在使用哪些扩展:
ls -l
extension=mcrypt.so
到
;;extension=mcrypt.so
sudo nano mcrypt.ini