如何使用BREW安装的PHP? [英] How to use the php that brew installed?

查看:205
本文介绍了如何使用BREW安装的PHP?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在我的Mac我有PHP的安装并正常工作。我最近想安装的mcrypt,所以我这样做使用BREW。虽然它似乎安装罚款,这并不在我的phpinfo显示()。所以,我认为在BREW安装mcrypt的PHP的,这不就是Apache使用PHP。

On my mac I've got php installed and working fine. I recently wanted to install mcrypt, so I did so using brew. Although it seemed to install fine, it doesn't show up in my phpinfo(). So I think that the php that brew installed mcrypt in, isn't the php that apache uses.

是否有人知道我可以:


  1. 检查是否有通过BREW安装了PHP和Apache使用PHP之间的差异?

  2. 让Apache使用BREW安装的PHP?

所有的提示是欢迎!

推荐答案

您必须让你的Apache使用您刚刚下载的PHP。

You have to make your Apache use the PHP that you just downloaded.


  • 打开的httpd.conf (我的是在 /etc/apache2/httpd.conf )并查找加载PHP模块行了,是这样的:

  • Open your httpd.conf (mine is at /etc/apache2/httpd.conf) and look for the line that loads the PHP module, something like:

的LoadModule php5_module路径/要/ PHP

然后,使其指向BREW为您安装与mcrypt的支持PHP。我的是在这条道路。您可以根据您所安装的PHP版本而异。

Then, make it point to the PHP that brew installed for you with mcrypt support. Mine was at this path. Yours can vary depending on the PHP version that you installed.

/usr/local/Cellar/php54/5.4.21/libexec/apache2/libphp5.so

最后,您将需要重新启动Apache服务器加载新的配置:

Finally you will need to restart your Apache server to load the new configuration:

须藤apachectl中重启

这篇关于如何使用BREW安装的PHP?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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