日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當(dāng)前位置: 首頁 > 运维知识 > linux >内容正文

linux

selinux php errors,apache php selinux --Syntax error 无法加载模块

發(fā)布時間:2025/4/5 linux 38 豆豆
生活随笔 收集整理的這篇文章主要介紹了 selinux php errors,apache php selinux --Syntax error 无法加载模块 小編覺得挺不錯的,現(xiàn)在分享給大家,幫大家做個參考.

centos 5.0selinux 為開啟狀態(tài)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?

相信提示大伙都能看懂。網(wǎng)上有解決辦法就是關(guān)閉selinux 下面講另二種方法一:按提示操作:(大體意思是將libphp5.so加入selinux系統(tǒng)內(nèi))

#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 的相應(yīng)權(quán)限。使用命令: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 一切搞定。

關(guān)于如上的方法,啟不動,查看日志,再按日志里的命令操作,接著又會得到提示。繼續(xù)操作。就可以完成安裝。

net-snmp 在selinux開啟的狀態(tài)下也無法啟動。需要用上面的方法來解決。或者直接關(guān)閉selinux 官網(wǎng)不推薦這么做。

一點小技巧。就到這吧。

本文轉(zhuǎn)自守住每一天51CTO博客,原文鏈接:http://blog.51cto.com/liuyu/78389,如需轉(zhuǎn)載請自行聯(lián)系原作者

總結(jié)

以上是生活随笔為你收集整理的selinux php errors,apache php selinux --Syntax error 无法加载模块的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網(wǎng)站內(nèi)容還不錯,歡迎將生活随笔推薦給好友。