【问题标题】:Zend Server CE messing with Apache?Zend Server CE 与 Apache 混淆?
【发布时间】:2012-01-18 22:23:38
【问题描述】:

我开始在 VirtualBox VM 上全新安装 Fedora 15,并尝试安装 Zend Server CE。要安装,我将 Zend 存储库添加到 yum 并运行:

sudo yum install zend-server-ce-php-5.3

安装本身似乎进行得很好。我按照指示在http://localhost:10081/ZendServer 打开了浏览器。单击许可证页面并输入管理密码后,出现错误:

 Failed to access Web server. Please make sure that the Web server is running and listening to the correct port

“应用程序”、“规则管理”和“管理”选项卡正常运行,但“监视器”和“服务器设置”选项卡均显示上述错误。 Web服务器没有运行是事实,但是当我尝试纠正时,我得到了另一个错误:

$ sudo service httpd start
[sudo] Password for XXXXX:
Starting httpd (via systemctl):  Job failed. See system logs and 'systemctl status' for details.
                                                           [FAILED]

对于它的价值(我猜并不多),以下是消息所指的详细信息:

$ sudo tail /var/log/messages
....
Jan 17 17:24:18 M5 systemd[1]: httpd.service: control process exited, code=exited status=1
Jan 17 17:24:18 M5 systemd[1]: Unit httpd.service entered failed state.

$ systemctl status httpd.service
httpd.service - LSB: start and stop Apache HTTP Server
      Loaded: loaded (/etc/rc.d/init.d/httpd)
      Active: failed since Tue, 17 Jan 2012 17:24:18 -0500; 3min 44s ago
     Process: 19500 ExecStart=/etc/rc.d/init.d/httpd start (code=exited, status=1/FAILURE)
      CGroup: name=systemd:/system/httpd.service

诊断似乎不是很有帮助。我尝试了各种方法,例如在安装 Zend Server CE 之前安装和启动 httpd,重新安装 httpd(不好:卸载它会导致 Zend 也卸载)。 httpd 配置没有引起问题,如下输出所示:

$ /usr/sbin/apachectl configtest
Syntax OK

这是一个已知问题吗?我的下一步行动是什么?我是否开始将调试语句放在控制脚本中以查看失败的原因?我可以这样做,但我希望有人已经解决了这个问题并可以给我一个快速的解决方案。

【问题讨论】:

  • apachectl configtest 显示什么?
  • @Phil 好问题,但我只是得到“语法正常”。将更新我的问题以反映这一点。

标签: zend-framework apache


【解决方案1】:

通过直接调用apachectl 脚本而不是使用service,我能够获得有关问题原因的更好信息:

$ sudo /usr/sbin/apachectl start
httpd: Syntax error on line 220 of /etc/httpd/conf/httpd.conf: Syntax error on line 6 of /etc/httpd/conf.d/zendserver_php.conf: Cannot load /usr/local/zend/lib/apache2/libphp5.so into server: /usr/local/zend/lib/apache2/libphp5.so: cannot enable executable stack as shared object requires: Permission denied

httpd.conf 上的语法检查没有发现这一点,因为它不是真正的语法错误,它也不在 httpd.conf 中,而是在包含的 zendserver_php.conf 中。快速搜索显示此错误是 libphp5.so 违反 SELinux 强制执行的约束之一的结果。 SELinux 在 Fedora 15 中默认启用。

我不喜欢降低安全性,但这是我看到解决此问题的唯一方法。所以我用命令暂时禁用了 SELinux

$ sudo setenforce 0

我还编辑了/etc/selinux/config 并将SELINUX=enforced 更改为SELINUX=disabled,这样SELinux 将在重新启动时保持禁用状态。现在我的网络服务器可以顺利启动:

[mike@M5 ~]$ sudo service httpd start
Starting httpd (via systemctl):                            [  OK  ]

我想 Zend 开发社区中的某个人正在研究这个共享库问题。在很多情况下,降低安全性不是可接受的解决方法。如果有人有更好的解决方案,我仍然想知道。

【讨论】:

  • 谢谢你,迈克..我也遇到了同样的问题。我已经在 cent os 上安装了 Apache。然后我得到了你在你的问题中提到的错误。然后我卸载了 apache 并给出了命令“setenforce 0”并重新启动了服务器..它完成了
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2016-03-27
  • 2012-02-11
  • 1970-01-01
  • 2014-07-09
  • 1970-01-01
相关资源
最近更新 更多