Plugging mcrypt into PHP, on Mac OS X Snow Leopard 10.6.1[转]

简介:

First mcrypt on Leopard, and now we ready for the winter cat. Additionally, special thanks goes out in advance to commenter Yvan Barthelemy (a.k.a. ybart) for cluing me in here. The procedure is almost exactly like the previous…almost. So pay attention.

The following instructions cater to those who a) are developing on OS X Snow Leopard 10.6.1, b) need the capabilities provided by mcrypt during their PHP development, and c) do not want to completely recompile PHP to get there. You’ll get mcrypt loading dynamically for use in PHP with this method.

First, you are going to need a few things…

1) libmcrypt-2.5.8, which you can pick up here; NOTE: make sure to get libmcrypt and not mcrypt.

2) PHP 5.3.0 source, which you grab hereADDITIONAL NOTE: You may have already updated your OS X beyond 10.6.1, and PHP may have been updated along with it. In this case, use phpinfo() to check your version of PHP, and then download the PHP source for that version. Thanks to commenter Blair for suggesting this note;

and

3) Xcode 3.2 tools, which you can pick up here (Apple Developer Connection membership required).

Next, create a directory at root called ‘SourceCache’ and dump the files from #1 and #2 in there and unwrap.

Move to the libmcrypt-2.5.8 directory, and punch in this…

MACOSX_DEPLOYMENT_TARGET=10.6 CFLAGS='-O3 -fno-common -arch i386 -arch x86_64' LDFLAGS='-O3 -arch i386 -arch x86_64' CXXFLAGS='-O3 -fno-common -arch i386 -arch x86_64' ./configure --disable-dependency-tracking

and then…

make -j6

and finally…

sudo make install

libmcrypt is ready – now for the PHP extension…

Move back to /SourceCache, then down to php-5.3.0/ext/mcrypt – type…

/usr/bin/phpize (phpize should be in /usr/bin – if not go find it and change the command as appropriate)

Then configure as follows…

MACOSX_DEPLOYMENT_TARGET=10.6 CFLAGS='-O3 -fno-common -arch i386 -arch x86_64' LDFLAGS='-O3 -arch i386 -arch x86_64' CXXFLAGS='-O3 -fno-common -arch i386 -arch x86_64' ./configure --with-php-config=/Developer/SDKs/MacOSX10.6.sdk/usr/bin/php-config

Again make -j6 then sudo make install

Make sure you have php.ini in the /etc directory (it will probably be php.ini.default to start, particularly if you’ve just done the Snow Leopard upgrade, so rename it). Ensure that enable_dl = On but do not remove the ; from in front of ;extension_dir = "./". Add one line to the .ini file in the Dynamic Extensions section… extension=mcrypt.so

Restart Apache – you should be all set (again), according to phpinfo():

BIG NOTE: As the substantive content of this guide has aged a number of new releases have come out, including but not limited to patches for Snow Leopard. As a result, PHP versions have changed, XCode has been updated, and more. If you come across quirks during your attempts to get mcrypt working, please read the comments before detailing your problem, as many of those issues have been solved. Finally, thanks go out to all of the folks who have contributed – it is greatly appreciated by all!

 

from: http://michaelgracie.com/2009/09/23/plugging-mcrypt-into-php-on-mac-os-x-snow-leopard-10.6.1/ 

欢迎加群互相学习,共同进步。QQ群:iOS: 58099570 | Android: 572064792 | Nodejs:329118122 做人要厚道,转载请注明出处!



















本文转自张昺华-sky博客园博客,原文链接:http://www.cnblogs.com/sunshine-anycall/archive/2010/11/08/1872239.html ,如需转载请自行联系原作者



相关文章
|
开发框架 应用服务中间件 PHP
Mac Nginx 关联 php 详细配置以及常见错误
Mac Nginx 关联 php 详细配置以及常见错误
241 1
|
NoSQL PHP Redis
Mac PHP安装Redis扩展
php安装redis的扩展 采用pecl命令进行安装; pecl命令,在使用brew 安装php时,已经为我们安装上了,这里我们直接使用即可。 我们先进入php的bin目录看下命令是否存在,对应路径如下: cd /opt/homebrew/Cellar/php@7.3/7.3.32 这里的7.3为我通过brew install [php@7.3]安装的php具体版本号,大家可以通过ls命令查看文件夹下是否存在pecl命令
1478 0
|
缓存 PHP 芯片
Mac M1芯片brew阿里云源,安装PHP时出的问题解决
安装时有两个文件404没有下载下来,它是回地官方源下载,但安装时名字还是用阿里的名字,所以打不到包,手动到缓存目录里改的。改成安装需要的包的名字。
1101 0
|
26天前
|
运维 JavaScript 应用服务中间件
os-copilot安装与多项功能测评,帮助开发人员PHP环境排查问题
本文介绍了OS Copilot在ECS上 Alibaba Cloud Linux的安装与使用,并对其多项参数进行了功能测评。OS Copilot是为操作系统提供智能化辅助的工具,支持自动化任务、智能推荐、故障排查等功能。安装时需检查是否已安装(`rpm -q os-copilot`),若未安装则用`yum install os-copilot`命令安装,并配置AccessKey信息连接阿里云服务。通过测试不同参数命令,如`-t`参数,展示了其自动化执行和智能生成回答的能力,显著提升运维效率。
os-copilot安装与多项功能测评,帮助开发人员PHP环境排查问题
|
6月前
|
Go PHP 数据安全/隐私保护
【应用服务 App Service】Azure App Service 中如何安装mcrypt - PHP
【应用服务 App Service】Azure App Service 中如何安装mcrypt - PHP
|
PHP Windows
PHP 错误日志设置 - MAC
PHP 错误日志设置 - MAC
157 0
|
数据可视化 关系型数据库 MySQL
在Mac系统下配置PHP运行环境
在Mac系统下配置PHP运行环境
239 0
在Mac系统下配置PHP运行环境
|
应用服务中间件 PHP nginx
mac下载切换不同PHP版本
mac下载切换不同PHP版本
273 0
mac下载切换不同PHP版本
|
应用服务中间件 PHP nginx
mac环境composer新建php的symfony项目并用nginx配置
mac环境composer新建php的symfony项目并用nginx配置
223 0
mac环境composer新建php的symfony项目并用nginx配置
|
安全 PHP
Mac下使用pecl安装PHP的swoole扩展实践
我记得之前用brew安装的PHP,再使用pecl很方便就可以安装swoole,于是我把自带的PHP卸载然后重新使用brew安装,并且安装了pecl,在通过pecl安装了swoole扩展,把这个安装过程记录下来,方便下次使用吧
737 0