在 Mac OS X 10.5.8 上安装 PHP 的 Mcrypt 扩展

发布于 2024-08-04 18:44:46 字数 47 浏览 2 评论 0原文

如何安装 mcrypt?我正在使用 Leopard 10.5.8 和 PHP5。

How do I install mcrypt? I'm using Leopard 10.5.8 with PHP5.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

撩起发的微风 2024-08-11 18:44:46

好的,我只是花了 1.5 小时尝试在 10.6.7 上自己完成此操作,

我相信解决方案是这样的:

我使用 macports 安装了 php5-mcrypt + universal

$ sudo macports php5-mcrypt +universal

那么,你不能只把 extension=mycrypt.sophp.ini 文件中,你必须输入直接路径,即:

extension = /opt/local/lib/php/extensions/no-debug-non-zts-20090626/mcrypt.so

你看,PHP 在 /usr/local/lib/php 中查找/extensions/no-debug-non-zts-20090626/
这就是我错过的区别!

然后用你的命令重新启动apache

$ sudo apachectl -k graceful

,然后

$ php -m | grep mcrypt

确保它在那里。

希望这对某人有帮助!

Ok, I just spent 1.5 hours trying to do this myself on 10.6.7

I believe the solution was this:

I installed php5-mcrypt + universal with macports:

$ sudo macports php5-mcrypt +universal

then, you can't just put extension=mycrypt.so in the php.ini file, you have to put the direct path i.e.:

extension = /opt/local/lib/php/extensions/no-debug-non-zts-20090626/mcrypt.so

you see, PHP looks in /usr/local/lib/php/extensions/no-debug-non-zts-20090626/
which is the difference I missed!!

Then just restart apache with your

$ sudo apachectl -k graceful

and then

$ php -m | grep mcrypt

to make sure it's there.

Hope this helps someone!

海夕 2024-08-11 18:44:46
 # Edit macports.conf
cd /opt/local/etc/macports
sudo nano macports.conf
# Change the line ....
universal_archs ppc i386
# to ...
universal_archs ppc ppc64 i386 x86_64

# Get the MCRYPT Library
sudo port install mcrypt +universal 

来源:此页面

 # Edit macports.conf
cd /opt/local/etc/macports
sudo nano macports.conf
# Change the line ....
universal_archs ppc i386
# to ...
universal_archs ppc ppc64 i386 x86_64

# Get the MCRYPT Library
sudo port install mcrypt +universal 

Source: This page.

做个ˇ局外人 2024-08-11 18:44:46

这取决于您安装 PHP 的方式。

如果您通过 macports 安装了 PHP,您可以:

sudo port install php5-mcrypt +universal

如果您自定义编译了 PHP,那么重新编译可能是最简单的:(

--with-mcrypt=/path/to/mcrypt

不确定 macports 实际将其保存在哪里,因为我不使用 macports,而只是编译我的 AMP 堆栈(和大多数依赖项)来自源)

It depends on how you've installed PHP.

If you installed PHP via macports, you can:

sudo port install php5-mcrypt +universal

If you custom-compiled your PHP, it's probably easiest to just recompile with:

--with-mcrypt=/path/to/mcrypt

(Not sure where macports actually keeps it, since I don't use macports, but just compile my AMP stack (and most dependencies) from source)

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文