无法在Apache(Homebrew OS X)中加载已安装的PHP版本 [英] Can't load installed PHP version in Apache (Homebrew OS X)

查看:110
本文介绍了无法在Apache(Homebrew OS X)中加载已安装的PHP版本的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

好吧,有一个类似的问题,但是情况有所不同-我想在OS-X Apache(2.4)和Homebrew(5.6)安装的PHP中使用build。

Ok there was question like that but situation was different - I want to use build - in OS-X Apache (2.4) and PHP installed by Homebrew (5.6).

所以我把它放在httpd.conf

So I put this is httpd.conf

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

当我重新启动Apache时,我会得到这个

And when i restart Apache I get this

httpd: Syntax error on line 118 of /usr/local/etc/apache2/2.2/httpd.conf: Cannot load /usr/local/opt/php56/libexec/apache2/libphp5.so into server: dlopen(/usr/local/opt/php56/libexec/apache2/libphp5.so, 10): Symbol not found: _ap_unixd_config\n  Referenced from: /usr/local/opt/php56/libexec/apache2/libphp5.so\n  Expected in: /usr/local/Cellar/httpd22/2.2.29/bin/httpd\n in /usr/local/opt/php56/libexec/apache2/libphp5.so

首先我也通过自制软件安装了apache2.2。但是我决定删除它并使用内置的。但是尽管如此,我还是通过自制程序删除了它,但它仍然存在。所以我有两个Apache,但我不太确定如何删除2.2版本。

Also First I have installed apache2.2 by homebrew as well. But I decided to remove it and used build-in one. But despite that I removed this in homebrew it is still there. So I have two apache and I am not really sure how to remove 2.2 version.

您能帮我这些吗?我已尽我所能,尝试了一切,所以请让我寻求您的帮助

Can you please help me with these? I tried everything my knowledge allows me to do, so please let me seek yours

推荐答案

如果apache找不到libphp5.so在给定的路径上没有libphp5.so。

If apache can't find libphp5.so there is no libphp5.so on given path.


  1. 卸载php56:brew卸载php56

  1. uninstall php56: brew uninstall php56

使用Apache选项再次安装php56:brew install php56 --with-apache

install php56 again with Apache option: brew install php56 --with-apache

在安装结束时,您可以查看在安装摘要(终端输出的最后一行)中找出libphp5.so的安装位置(我的情况在/usr/local/Cellar/php56/5.6.32_8中)。

At the end of installation you can look at summary of installation (last line of terminal output) to find out where libphp5.so is installed (im my case in /usr/local/Cellar/php56/5.6.32_8).

现在您应该在/usr/local/Cellar/php56/5.6.32_8/libexec/apache2

Now you should find libphp5.so in /usr/local/Cellar/php56/5.6.32_8/libexec/apache2

这篇关于无法在Apache(Homebrew OS X)中加载已安装的PHP版本的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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