安装完成之后,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?
#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 http://people.redhat.com/drepper/selinux-mem.html 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 http://bugzilla.redhat.com/bugzilla/enter_bug.cgi 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
我运气不好哈,加入后还是启不来:
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版本。