centos 5.0selinux 为开启状态apache 2.2.8php 5.0安装完成之后,apache无法加载php模块。错误如下:

httpd: Syntax error on line 232 of /usr/local/apache2/conf/httpd.conf: API module structure 'php5_module' in file /usr/local/apache2/modules/libphp5.so is garbled - expected signature 41503232 but saw 41503230 - perhaps this is not an Apache module DSO, or was compiled for a different Apache version?

相信提示大伙都能看懂。网上有解决办法就是关闭selinux 下面讲另二种方法一:按提示操作:(大体意思是将libphp5.so加入selinux系统内)

#tail /var/log/messages

May 23 10:08:15 nagios setroubleshoot:      SELinux is preventing /usr/local/apache2/bin/httpd from loading /usr/local/apache2/modules/libphp5.so which requires text relocation.      For complete SELinux messages. run sealert -l e693621e-145b-4431-bdcb-68b3883f1ac8

# sealert -l e693621e-145b-4431-bdcb-68b3883f1ac8

Summary

SELinux is preventing /usr/local/apache2/bin/httpd from loading

/usr/local/apache2/modules/libphp5.so which requires text relocation.

Detailed Description

The /usr/local/apache2/bin/httpd application attempted to load

/usr/local/apache2/modules/libphp5.so which requires text relocation.  This

is a potential security problem. Most libraries do not need this permission.

Libraries are sometimes coded incorrectly and request this permission.  The

[url]http://people.redhat.com/drepper/selinux-mem.html[/url] web page explains how to

remove this requirement.  You can configure SELinux temporarily to allow

/usr/local/apache2/modules/libphp5.so to use relocation as a workaround,

until the library is fixed. Please file a

[url]http://bugzilla.redhat.com/bugzilla/enter_bug.cgi[/url] against this package.

Allowing Access

If you trust /usr/local/apache2/modules/libphp5.so to run correctly, you can

change the file context to textrel_shlib_t. "chcon -t textrel_shlib_t

/usr/local/apache2/modules/libphp5.so"The following command will allow this access:

chcon -t textrel_shlib_t /usr/local/apache2/modules/libphp5.so

Additional Information

Source Context                user_u:system_r:unconfined_t

Target Context                system_u:object_r:lib_t

Target Objects                /usr/local/apache2/modules/libphp5.so [ file ]

Affected RPM Packages

Policy RPM                    selinux-policy-2.4.6-30.el5

Selinux Enabled               True

Policy Type                   targeted

MLS Enabled                   True

Enforcing Mode                Permissive

Plugin Name                   plugins.allow_execmod

Host Name                     nagios

Platform                      Linux nagios 2.6.18-8.el5 #1 SMP Thu Mar 15

19:57:35 EDT 2007 i686 i686

Alert Count                   3

Line Numbers

Raw Audit Messages

avc: denied { execmod } for comm="httpd" dev=sda3 egid=0 euid=0

exe="/usr/local/apache2/bin/httpd" exit=0 fsgid=0 fsuid=0 gid=0 items=0

name="libphp5.so" path="/usr/local/apache2/modules/libphp5.so" pid=31706

scontext=user_u:system_r:unconfined_t:s0 sgid=0

subj=user_u:system_r:unconfined_t:s0 suid=0 tclass=file

tcontext=system_u:object_r:lib_t:s0 tty=pts0 uid=0

注意红色字体:大体的意思是 您需要改变libphp5.so 的相应权限。使用命令:chcon -t textrel_shlib_t /usr/local/apache2/modules/libphp5.so我运气不好哈,加入后还是启不来:

httpd: Syntax error on line 232 of /usr/local/apache2/conf/httpd.conf: API module structure 'php5_module' in file /usr/local/apache2/modules/libphp5.so is garbled - expected signature 41503232 but saw 41503230 - perhaps this is not an Apache module DSO, or was compiled for a different Apache version?

二:大家看最后一行。or was compiled for a different Apache version?

或编译不同的apache版本。

OK  换成 apache 2.0 一切搞定。

关于如上的方法,启不动,查看日志,再按日志里的命令操作,接着又会得到提示。继续操作。就可以完成安装。

net-snmp 在selinux开启的状态下也无法启动。需要用上面的方法来解决。或者直接关闭selinux 官网不推荐这么做。

一点小技巧。就到这吧。

本文转自守住每一天51CTO博客,原文链接:http://blog.51cto.com/liuyu/78389,如需转载请自行联系原作者

selinux php errors,apache php selinux --Syntax error 无法加载模块相关推荐

  1. Adobe Flash player 10 提示:Error#2044:未处理的IOErrorEvent. text=Error#2036:加载未完成 的解决方法

    Adobe Flash player 10 提示:Error#2044:未处理的IOErrorEvent. text=Error#2036:加载未完成 的解决方法 参考文章: (1)Adobe Fla ...

  2. VS2019 error  : 无法加载具有重复项目项的项目: ....作为 Image 且作为 Image 项类型包括在其中。

    拷贝过来的一个vcc solution,打开时无法加载其中的项目,报错内容如下, error  : 无法加载具有重复项目项的项目: res\POLYGON.png 作为 Image 且作为 Image ...

  3. Apache SkyWalking Java Agent 05-插件加载机制(下)

    基于 SkyWalking Java Agent 8.8.0 版本 上一篇文章中我们重点分析了自定义类加载器 AgentClassLoader.initDefaultLoader() 部分,Agent ...

  4. apache模块载入命令_Apache动态加载模块实例讲解

    我们都知道apache有个优秀的功能就是模块化设计,很多第三方模块都可以在apache编译好了之后给加上,一下模块既可以在安装apache的时候静态编译好,也可以在apache编译好后,通过apach ...

  5. apache 已经加载模块,但是不能解析出开发的rewrite模块功能

    例如  这样配置虚拟域名上正确的DocumentRoot与Directory是有顺序的 <VirtualHost *:80>     ServerAdmin webmaster@dummy ...

  6. Linux在加载模块时报insmod: error inserting xxx.ko -1 File exists这个错

    insmod: error inserting xxx.ko': -1 File exists 在写Linux块设备驱动时,insmod xxx.ko时出现错误:insmod: error inser ...

  7. Windows下使用apache模块实现合并多个js、css提高网页加载速度

    这篇文章主要介绍了Windows下使用apache模块实现合并多个js.css提高网页加载速度,本文使用的模块是基于mod_concat自己修改的,需要的朋友可以参考下 现在的网站表现力越来越丰富,页 ...

  8. 编译安装apache2.2对应的mod_proxy_fcgi.so模块步骤,apache进行fcgi通信需要加载该模块

    编译安装apache2.2对应的mod_proxy_fcgi.so模块步骤,因为使用apache--phpfpm 需要这个 #mod-proxy-fcgi-master 模块步骤 [root@iZ25 ...

  9. SELinux中的Apache和MySQL设定

    原贴:http://www.gofun.com.cn:8080/viewtopic.php?f=8&t=234 SELinux中的Apache和MySQL设定    Page 1 of 1   ...

最新文章

  1. 用路由器限制局域网的带宽流量
  2. 同步电机调速matlab,基于matlab的永磁同步电机调速系统的仿真word格式
  3. 手游建筑美术资源_建筑商和机械手
  4. php教程调用数据库,PHP数据库调用类调用实例,php数据库调用实例_PHP教程
  5. 成为被 BAT 疯抢的数据分析师,要如何精进技术?
  6. 下滑加载更多js_vue.js怎么实现滑动到底部加载更多数据效果?
  7. 回文数问题,两数互换位置问题(不用第三个变量)
  8. mysql集群脑裂问题_redis集群怎么解决脑裂问题
  9. Turbo C 2.0
  10. 一套5A数据中心机房建设方案(143页),可作投标技术方案模板
  11. matlab中迪杰斯特拉算法,dijkstra算法(迪杰斯特拉算法)
  12. 明日书苑:《九成宫醴泉铭》单字放大米字格临帖字帖
  13. 计算机考研方向哪个好考,2022考研:计算机专业考研选择哪个方向比较好就业?...
  14. 360浏览器打不开html5文件,为什么电脑总是打不开360浏览器
  15. Oracle的视图,索引,约束,事务,数据库范式
  16. CCF GitLink开源编程夏令营 · 学生开放报名!
  17. 复古传奇服务器维护时间,复古传奇手游刷怪时间
  18. Superset 数据分析平台搭建及使用 1
  19. Linux中的管道和过滤器
  20. java学习笔记四:正则表达式

热门文章

  1. make: *** [out/target/common/obj/APPS/Phone_intermediates/classes-full-debug.jar] 错误 41
  2. 更新网盘(云存储)功能需求,免费网盘需求,手机数据备份
  3. 6.项目资源管理总结
  4. 计算机控制水槽液位控制,计算机过程控制实验报告单容水箱液位数学模型的测定实验...
  5. 基于DVB-T标准,COFDM调制系统的利用导频信号进行符号粗同步
  6. 十四、linux 静态/动态申请字符设备号
  7. 转:数学之美番外篇:平凡而又神奇的贝叶斯方法 收藏
  8. Java版本多用户B2B2C商城源码-(八)消息总线(Spring Cloud Bus)
  9. 【刷算法】两个链表的第一个公共结点
  10. Android Material Design :LinearLayoutCompat添加分割线divider