安装mcrypt扩展为PHP在OSX山狮 [英] Installing mcrypt extension for PHP on OSX Mountain Lion

查看:217
本文介绍了安装mcrypt扩展为PHP在OSX山狮的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在提前为潜在的n00b问题道歉,我想我的OSX山狮机上安装PHP的mcrypt扩展。

Apologies in advance for the potential n00b questions, I am trying to install the mcrypt extension for PHP on my OSX Mountain Lion machine.

在终端下面的步骤是我迄今所做实现我的PHP安装

The following steps in terminal is what I have done so far to achieve my PHP install

cd /path/to/downloaded/php-5.3.21/ext/mcrypt/
/usr/bin/phpize
./configure
cd /path/to/downloaded/php-5.3.21
./configure --with-config-file-path=/private/etc/php.ini --with-apxs2=/usr/sbin/apxs
make
sudo make install

这似乎运作良好,并安装PHP 5.3.21罚款。我已经做了那么

Which seems to work well and installs PHP 5.3.21 fine. I have then done

sudo nano /private/etc/php.ini

和包括

extension=mcrypt.so

随着一个Apache重新启动,phpinfo()函数不表明mcrypt扩展被加载。

Along with an Apache restart, phpinfo() doesn't show that the mcrypt extension is loaded.

我又试图指定在php.ini中extension_dir中,再次没有运气。

I then tried to specify the extension_dir inside php.ini, again with no luck.

我已经做了

locate mcrypt.so
/opt/local/lib/php/extensions/no-debug-non-zts-20090626/mcrypt.so
/usr/local/Cellar/php53-mcrypt/5.3.18/mcrypt.so

和试用过的目录中的extension_dir,没有运气。

And tried both directories as the extension_dir, with no luck.

我也曾尝试以下,经过多次谷歌搜索

I have also tried the following, after much Googling

./configure --with-config-file-path=/private/etc/php.ini --with-apxs2=/usr/sbin/apxs --with-mcrypt

这似乎工作确定,但随后在制造,则返回

Which seems to work OK, but then upon "make", it returns

ext/mcrypt/mcrypt.o: No such file or directory
ext/mcrypt/mcrypt_filter.o: No such file or directory

再次没有成功。

我是什么做错了吗?好像mcrypt.so的物理编译没有发生,或者编译错误,因为我会怀疑是另一个mcrypt.so发现下定位?

What am I doing wrong? It seems like the physical compile of mcrypt.so is not happening, or is compiling incorrectly as I would suspect there to be another mcrypt.so found under locate?

请人帮助吗?我已经通过在页面的谷歌搜索页面消失了,没有运气!

Anyone please help? I've gone through pages upon pages of Google searches with no luck!

推荐答案

我倾向于在Mac上使用自制。它将安装和配置所有的东西给你。结果
http://mxcl.github.com/homebrew/

I tend to use Homebrew on Mac. It will install and configure all the stuff for you.
http://mxcl.github.com/homebrew/

那么你应该能够与安装BREW安装的mcrypt php53-mcrypt的,它会正常工作(TM)。

Then you should be able to install it with brew install mcrypt php53-mcrypt and it'll Just Work (tm).

不要还记得,如果你使用的是内置在Mac PHP它安装到的/ usr / bin中您可以看到PHP,您使用的是带有的PHP 在终端,它会返回的路径。

Do also remember that if you are using the built in Mac PHP it's installed into /usr/bin you can see which php you are using with which php at the terminal and it'll return the path.

这篇关于安装mcrypt扩展为PHP在OSX山狮的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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