如何在Mac OS X优胜美地(10.10)上安装mcrypt扩展 [英] How to install mcrypt extension on mac os x yosemite (10.10)

查看:75
本文介绍了如何在Mac OS X优胜美地(10.10)上安装mcrypt扩展的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经将Mac OS X更新为优胜美地,但是这样做会覆盖我所有的开发环境.所以现在,要在本地apache上运行Laravel 4,我需要安装Mcrypt扩展,但是我尝试的所有操作都失败了.甚至适用于OS X Mavericks(10.9)的步骤

I've updated my Mac OS X to Yosemite, but doing that I over write all my dev environment. So now, to run Laravel 4 on my local apache I need to install the Mcrypt extension, but everything that i've tried i fail. Even the steps that have worked on OS X Mavericks (10.9)

有人遇到同样的问题吗? 预先感谢.

Anybody has the same issue? Thanks in advance.

欢呼

推荐答案

我现在刚刚使用自制软件在我的Mavericks安装中安装了它,并且效果非常好.无法说出它在优胜美地上是否能很好地工作,但值得一试.

I just installed it right now on my Mavericks installation using homebrew and it worked surprisingly well. Can't say whether or not it will work so well on Yosemite but worth a shot..

brew install autoconf
brew install mcrypt


Macports

  1. 检查PHP版本

  1. Check PHP version

php -v

  • 更新Macports

  • Update Macports

    sudo port -v selfupdate
    

  • 下载&安装适当的版本.

  • Download & install the appropriate version..

    sudo port install php55-mcrypt
    

    现在进行虚拟证明.

    查找Macports放置文件mcrypt.so的位置,然后将其复制到/php/extensions/no-debug-...文件夹的所有实例.如果您在多个地方都有该目录结构,请将其复制到所有目录中.因此,您计算机上的每个php/extensions/no-debug ..文件夹都具有mcrypt.so

    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/
    

  • 确定您的php.ini文件在哪里,并确保它是您实际使用的文件,因为您可能将此文件放在多个位置.对找到的所有php.ini文件执行此操作.

  • 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..

    在该文件中找到并取消注释以下行.如果已将其注释掉,请取消注释.如果根本不在文件中,请添加它.在我的默认php.ini文件中,我在第536行找到了这个

    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
    

  • 编译

    1. 下载mcrypt

    1. 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
    

  • 下载Autoconf

  • 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

    无论您使用哪种方法安装它.完成后,您应该始终重新启动Apache.


    Apache

    Regardless which method you used to install it. You should always restart Apache when your done.

    1. 重新启动Apache

    1. Restart Apache

    sudo apachectl restart
    

    这篇关于如何在Mac OS X优胜美地(10.10)上安装mcrypt扩展的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

    查看全文
    登录 关闭
    扫码关注1秒登录
    发送“验证码”获取 | 15天全站免登陆