在OSX 10.8.2上安装mcrypt-使用自制软件的PHP 5.3.15 [英] Installing mcrypt on OSX 10.8.2 - PHP 5.3.15 with homebrew

查看:78
本文介绍了在OSX 10.8.2上安装mcrypt-使用自制软件的PHP 5.3.15的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经通过homebrew成功安装了mcrypt,但是我很难找到mcrypt.so的路径以将其作为php.ini中的扩展包含在内.

I've successfully installed mcrypt via homebrew but I'm struggling to find the path to mcrypt.so to include it as an extension in php.ini.

mcrypt已安装在/usr/local/Cellar/mcrypt/2.5.8.树:

mcrypt was installed at /usr/local/Cellar/mcrypt/2.5.8. Tree:

-- AUTHORS
|-- ChangeLog
|-- INSTALL_RECEIPT.json
|-- NEWS
|-- README
|-- TODO
|-- bin
|   `-- libmcrypt-config
|-- include
|   |-- mcrypt.h
|   `-- mutils
|       `-- mcrypt.h
|-- lib
|   |-- libmcrypt.4.4.8.dylib
|   |-- libmcrypt.4.dylib -> libmcrypt.4.4.8.dylib
|   `-- libmcrypt.dylib -> libmcrypt.4.4.8.dylib
`-- share
    |-- aclocal
    |   `-- libmcrypt.m4
    `-- man
        `-- man3
            `-- mcrypt.3

我试图将mcrypt.h包含在php.ini中:

extension="/usr/local/Cellar/mcrypt/2.5.8/include/mcrypt.h"

,然后重新启动apache. 但这没用.

and then restarted apache. but it didn't work.

当我在终端中运行php时,我得到:

when I run php in the terminal I get:

PHP Warning:  PHP Startup: Unable to load dynamic library
'/usr/local/Cellar/mcrypt/2.5.8/include/mcrypt.h' - dlopen(/usr/local/Cellar/mcrypt/2.5.8/include/mcrypt.h, 9): 
image not found in Unknown on line 0

推荐答案

首先检查brew是否为最新版本:
brew doctor

First check if brew is up-to-date:
brew doctor

根据php版本第二次安装mcrypt:
brew install php53-mcrypt

Second install mcrypt based on php version:
brew install php53-mcrypt

NB:最新版本的brew不需要以下第三步:

第三打开php.ini文件并添加参考:
sudo vi /private/etc/php.ini
extension="/usr/local/Cellar/php53-mcrypt/5.3.25/mcrypt.so"

Third open php.ini file and add reference:
sudo vi /private/etc/php.ini
extension="/usr/local/Cellar/php53-mcrypt/5.3.25/mcrypt.so"

最后,重新启动apache:
sudo apachectl restart

Finally, restart apache:
sudo apachectl restart

这篇关于在OSX 10.8.2上安装mcrypt-使用自制软件的PHP 5.3.15的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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