Install mcrypt for php on Mac OSX 10.10 Yosemite for a Development Server
mcrypt is a file encryption method using secure techniques to exchange data. It is required for some web apps for example Magento, the shopping cart software or a php framework likeLaravel. This tutorial has been tested in OSX 10.10 Yosemite.
This guide is really for users with the version of PHP that shipped with OSX Yosemite which is version 5.5.14. Other downloadable AMP stacks already have mcrypt baked in.
Command Line Tools
First up you will need the OSX 10.10 version of Command Line Tools which you can download via the Apple available updates in the App store.
Run in the Terminal
xcode-select --install
Getting it on in OS X Yosemite 10.10
This tutorial works mostly in the Terminal, launch it from /Applications/Utilities, change directory (cd) to the home account and make a directory that you will work in, call it mcrypt
cd ~ ; mkdir mcrypt ; cd mcrypt
Get libmcrypt 2.5.8 from Sourceforge, this is direct download link.
Get the php code in a tar.gz or .bz2 format- (version 5.5.14 is the one that currently ships with OSX 10.10)
Move both of these files that you downloaded into your working directory – mcrypt in this instance, and go back to Terminal
cd ~/mcrypt
Expand both files via the command line or just double click them in the Finder:
tar -zxvf libmcrypt-2.5.8.tar.gz
tar -zxvf php-5.5.9.tar.gz
Remove the compressed archives
rm *.gz
Any errors on the command line including C++ and g++ mostly are due to the command line tools missing.
Configuring libmcrypt
cd libmcrypt-2.5.8
./configure
make
sudo make install
With the libmcrypt configured and libraries now installed, time for to make the mcrypt extension.
Install Autoconf
Install autoconf – some more Terminal heavy lifting:
cd ~/mcrypt
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
Compile mcrypt php Extension
cd ../php-5.5.9/ext/mcrypt/
/usr/bin/phpize
Output should be similar to:
Configuring for:
PHP Api Version: 20121113
Zend Module Api No: 20121212
Zend Extension Api No: 220121212
./configure
make
sudo make install
The result of this should be similar to:
Installing shared extensions: /usr/lib/php/extensions/no-debug-non-zts-20121212/
Enabling mcrypt.so php Extension
Open /etc/php.ini and add the line below at the end
extension=mcrypt.so
If there is no php.ini file, then you need to make one from php.ini.default in the same location like so:
sudo cp /etc/php.ini.default /etc/php.ini
And allow write capability
sudo chmod u+w /etc/php.ini
Then add the line as above in your favourite text editor:
sudo nano /etc/php.ini
or
sudo vi /etc/php.ini
and add in the line:
extension=mcrypt.so
Restart Apache
sudo apachectl restart
That’s it, create a php page with the function phpinfo(); to see if it loaded correctly.
If it didn’t load you may need to declare the extensions directory in /etc/php.ini
extension_dir = "/usr/lib/php/extensions/no-debug-non-zts-20100525/"
Hopefully it wasn’t too much of a nightmare…

tales-from-the-mcrypt-yosemite-osx-php
转自:http://coolestguidesontheplanet.com/install-mcrypt-php-mac-osx-10-10-yosemite-development-server/
Install mcrypt for php on Mac OSX 10.10 Yosemite for a Development Server的更多相关文章
- 在OSX狮子(Lion)上安装MYSQL(Install MySQL on Mac OSX)
这篇文章简述了在Mac OSX狮子(Lion)上安装MySQL Community Server最新版本v10.6.7的过程. MySQL是最流行的开源数据库管理系统.首先,从MySQL的下载页面上下 ...
- Mac OSX 下配置 LNMP开发环境
不久前负责了一个项目需要配置PHP7的开发环境,因为之前所有的项目用的是PHP5的,所以研究了这些东西,但是很遗憾,电脑出了问题,不得已重装了系统,然后你懂得...什么都没有了,要重新来过.. 虽然本 ...
- Mac OSX操作系统安装和配置Zend Server 6教程(1)
作为web开发人员,应该熟悉掌握各种系统下安装和配置web服务器与站点的技术. 随着越来越多的开发人员选择Zend Server服务器,慧都推出了在Mac OSX系统安装和配置Zend Server ...
- XE6移动开发环境搭建之IOS篇(7):在Mac OSX 10.8中安装Xcode4.6.3(有图有真相)
网上能找到的关于Delphi XE系列的移动开发环境的相关文章甚少,本文尽量以详细的图文内容.傻瓜式的表达来告诉你想要的答案. 原创作品,请尊重作者劳动成果,转载请注明出处!!! 在安装Xcode前, ...
- 虚拟机VMware 9安装苹果MAC OSX 10.8图文教程
前些天虚拟机VMware Workstation 9出来,相信大家都已经熟悉VM9了,至于MAC OSX 10.8系统,那也是出来一段时间了,本篇文章就是来讲解VMware Workstation 9 ...
- 深度学习框架-caffe安装-环境[Mac OSX 10.12]
深度学习框架-caffe安装 [Mac OSX 10.12] [参考资源] 1.英文原文:(使用GPU) [http://hoondy.com/2015/04/03/how-to-install-ca ...
- 深度学习框架-caffe安装-Mac OSX 10.12
p.p1 { margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px ".PingFang SC"; color: #454545 } p.p2 ...
- Mac OSX Yosemite 10.10 brew 错误:mktemp: mkdtemp failed on /tmp/git-LIPo: No such file or directory
这个问题困扰了我非常久非常久.使得我不得不花一点时间来说一下解决方法. 事情是这种:前两天兴高採烈的更新了一下宝贝mac到10.10. 一切看起来都那么美好,可是. .当我又一次安装magento的时 ...
- Webstorm 10 for mac osx 注册机,序列号,kegen
小菜最近get到mac体验机会,早就耳闻mac非常适合做开发,于是迫不及待的安装各种开发工具,不知不觉,轮到前端开发神器webstorm了,看了一下官网的价格,心拔凉拔凉的. 果断搜索注册机,搜到的结 ...
随机推荐
- codeforces 590A A. Median Smoothing(思维)
题目链接: A. Median Smoothing time limit per test 2 seconds memory limit per test 256 megabytes input st ...
- asp.net中三层架构与mvc之区别?
对于标题中的问题,如果是没有同时接触三层架构和mvc的初级.net开发人员,想必一定会非常糊涂和混淆.关于此我也百度过N回,看过N多帖子和 回答,但几乎没有人能表述清楚.近期我从典型mvc+entit ...
- 【转】windows 如何查看端口占用情况?
开始--运行--cmd 进入命令提示符 输入netstat -ano 即可看到所有连接的PID 之后在任务管理器中找到这个PID所对应的程序如果任务管理器中没有PID这一项,可以在任务管理器中选&qu ...
- 使用Gmail发送邮件心得
/// <summary> /// 发送邮件 /// </summary> /// <returns></returns> public static ...
- Charles 应用
1.首先设置本机host文件,将需要测试的域名指向127.0.0.1:(测试域名没有代理,才会这么操作): 2.打开Charles,设置Proxy选项,取消“Windows Proxy”选中状态: 3 ...
- AndroidStudio开发工具快捷键
在这里,自己整理了下在使用AndroidStudio开发工具所使用到的一些快捷键提示,也出于在开发过程中节省时间提升效率,然而可能多数开发者之前使用的都是Eclipse开发工具,可能开始都不习惯,但是 ...
- 第六十九篇、OC_录制语音和播放语音功能的实现
录制: 1.设置全局属性 NSURL *recordedFile;//存放路径 AVAudioPlayer *player;//播放 AVAudioRecorder *recorder;//录制 NS ...
- IOS自定义场景切换动画。
IOS中我们可以通过Storyborad以及segue来实现我们自己的场景切换动画,新建项目使用Single View Application模板并取名为MyCustomSegue. 使用storyb ...
- 在浏览器中打开本地应用(iOS)
在浏览器中点击跳转到本地应用的方法(如果本地没有安装的话) 然后在浏览器中输入tianxiang://就能打开这个应用了 ................省略 遇到一个12年还是初中的小朋友,
- 【C语言】02-函数
一.函数的分类 前面已经说过,C语言中的函数就是面向对象中的"方法",C语言的函数可以大概分为3类: 1.主函数,也就是main函数.每个程序中只能有一个.也必须有一个主函数.无论 ...