简体   繁体   English

无法在Apache中加载已安装的PHP版本(Homebrew OS X)

[英]Can't load installed PHP version in Apache (Homebrew OS X)

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). 好吧有这样的问题,但情况不同 - 我想使用构建 - 在OS-X Apache(2.4)和Homebrew安装的PHP(5.6)。

So I put this is httpd.conf 所以我把这个是httpd.conf

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

And when i restart Apache I get this 当我重新启动Apache时,我得到了这个

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

Also First I have installed apache2.2 by homebrew as well. 首先,我也通过自制软件安装了apache2.2。 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. 所以我有两个apache,我不确定如何删除2.2版本。

Can you please help me with these? 你能帮帮我吗? I tried everything my knowledge allows me to do, so please let me seek yours 我尝试了我的知识允许我做的一切,所以请让我寻求你的

If apache can't find libphp5.so there is no libphp5.so on given path. 如果apache找不到libphp5.so,则给定路径上没有libphp5.so。

  1. uninstall php56: brew uninstall php56 卸载php56:brew卸载php56

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

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

  4. Now you should find libphp5.so in /usr/local/Cellar/php56/5.6.32_8/libexec/apache2 现在你应该在/usr/local/Cellar/php56/5.6.32_8/libexec/apache2中找到libphp5.so

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM