mcrypt php 扩展 mac,mac lion10.8中安装mcrypt php扩展

以前安装opencart的时候倒是不需要mcrypt 这个库。但是新版本需要了。加上自己的 是mac环境。当时闲麻烦,就一直没装。这次下午就寻思给装上吧! 1.首先你要先安装xcode这个工具。不然没办法编译! xcode这个可以在苹果appstore下载。 2.安装command line tools 打开xcode .->> Preferences 然后点击command line toolsinstall  等下再完成安装就行了 也可以按照这个国外高人写的安装 https://github.com/kennethreitz/osx-gcc-installer 3.安装 Autoconfcd /tmp

curl -O http://ftp.gnu.org/gnu/autoconf/autoconf-latest.tar.gz

tar xvfz autoconf-latest.tar.gz

cd autoconf-2.69/

./configure

make

sudo make install

(需要输入你的密码)

autoconf --version 老验证是否安装成功

fyhqytekiMacBook-Pro:tmp fyhqy$ autoconf --version

autoconf (GNU Autoconf) 2.69

Copyright (C) 2012 Free Software Foundation, Inc.

License GPLv3+/Autoconf: GNU GPL version 3 or later

, This is free software: you are free to change and redistribute it.

There is NO WARRANTY, to the extent permitted by law.

Written by David J. MacKenzie and Akim Demaille.

4. 安装 libmcrypt 先检查机器的php版本。默认10.8安装的php版本是5.3.15.fyhqytekiMacBook-Pro:tmp fyhqy$ php -v

PHP 5.3.15 with Suhosin-Patch (cli) (built: Aug 24 2012 17:45:44)

Copyright (c) 1997-2012 The PHP Group

Zend Engine v2.3.0, Copyright (c) 1998-2012 Zend Technologies

下载对应版本的php版本包  5.3.15源码包   可以自己去页面下载。默认的托管在sina的sae上面http://cn2.php.net/distributions/php-5.3.15.tar.gz

这个是5.3.15版本所有下载地址http://php.net/get/php-5.3.15.tar.gz/from/a/mirror

curl -O http://cn2.php.net/distributions/php-5.3.15.tar.gz

tar zxvf php-5.3.15.tar.gz

cd php-5.3.15/ext/mcrypt/

/usr/bin/phpize

./configure

make

sudo make install

编译的时候可能会提示这行configure: error: mcrypt.h not found. Please reinstall libmcrypt.

这是因为没有安装mcryptcurl -O http://sourceforge.net/projects/mcrypt/files/Libmcrypt/2.5.8/libmcrypt-2.5.8.tar.gz

tar zxvf libmcrypt-2.5.8.tar.gz

cd libmcrypt-2.5.8

./configure --prefix=/usr/local/Cellar/mcrypt/2.5.8 --mandir=/usr/local/Cellar/mcrypt/2.5.8/shar

make

sudo make install

然后再执行上面步骤! 安装完成之后会提示Installing shared extensions: /usr/lib/php/extensions/no-debug-non-zts-20090626/

然后修改php.ini。把扩展添加进去 php.ini 存在  /etc/php.iniextension=mcrypt.so

sudo apachectl restart

重启下apache。然后打开phpinfo();  看是不是已经安装上了嗯!

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值