强制 Apache2 使用 Homebrew 中的 php56 [英] Forcing Apache2 to use php56 from Homebrew

查看:26
本文介绍了强制 Apache2 使用 Homebrew 中的 php56的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

所以我从

brew reinstall php56 --with-apache

这很好用然后我修改了 httpd.conf 以包含

This worked fine I then amended httpd.conf to include

LoadModule php5_module /usr/local/opt/php56/libexec/apache2/libphp5.so

但是在检查 phpinfo 时它使用的是错误的 PHP 5.6.24,那是 MacOS 原生版本.brew 版本是 5.6.26.

But upon inspection of phpinfo its using PHP 5.6.24 which is wrong, thats the MacOS native version. The brew version is 5.6.26.

出于某种原因,我的 Apache2 配置被忽略了 - 或者我修改了错误的文件.我在 /etc/apche2/httpd.conf

For some reason my Apache2 config is being ignored - or I have amended the wrong file. The one I changed as in /etc/apche2/httpd.conf

这是我的上一个问题 与让 APCu 工作有关.它适用于 PHP 的 brew 版本,但不适用于本机 PHP 版本.因此,我想强制 Apache2 使用带有 APCu 的 brew 版本.

This is a follow on from my previous question related to getting APCu working. Its working for the brew version of PHP but is not working for the the native PHP version. Therefore I want to force Apache2 to use the brew version with APCu.

推荐答案

我正在重新启动 apache,但结果发现它不起作用.

I was restarting apache, but it was not working it turns out.

重新启动我的整个机器确实有效,然后 apache 使用了正确版本的 PHP.

Restarting my whole machine did work and apache then used the correct version of PHP.

显然 killall httpd 也有同样的效果.虽然我没试过.

Apparently killall httpd has the same effect too. Although I have not tried that.

这篇关于强制 Apache2 使用 Homebrew 中的 php56的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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