**求助**Apache 2.0.55 无法加载 libphp5.so 模块

OK!
SLINUX原因,一直想不关闭SELINUX来解决


failed to map segment from shared object

QUOTE:
[root@mediawiki log]# service httpd restart
Stopping httpd:                                            [FAILED]
Starting httpd: Syntax error on line 191 of /etc/httpd/conf/httpd.conf:
Cannot load /usr/lib/httpd/modules/libphp5.so into server: libgd.so.2: failed to map segment from shared object: Permission denied
                                                           [FAILED]



QUOTE:
#tail messages

Oct  9 08:58:22 mediawiki httpd: httpd shutdown failed
Oct  9 08:58:22 mediawiki kernel: audit(1223513902.879:3): avc:  denied  { execute } for  pid=31077 comm="httpd" name="libgd.so.2.0.0" dev=dm-0 ino=180696 scontext=root:system_r:httpd_t tcontext=root:object_r:usr_t tclass=file
Oct  9 08:58:22 mediawiki httpd: Syntax error on line 191 of /etc/httpd/conf/httpd.conf:
Oct  9 08:58:22 mediawiki httpd: Cannot load /usr/lib/httpd/modules/libphp5.so into server: libgd.so.2: failed to map segment from shared object: Permission denied



QUOTE:
PHP5
         # tar -jxvf php-5.2.3.tar.bz2
         # cd php-5.2.3
         #./configure --prefix=/usr/local/php --with-apxs2=/usr/sbin/apxs --with-libxml-dir=/usr/local/libxml2  --with-gd=/usr/local/gd2 --enable-mbstring --with-mysql=/usr/bin/mysql  --with-mcrypt=/usr/local/libmcrypt
         #make
         #make install

apache
    yum install httpd httpd-devel

QUOTE:
#chcon  /usr/lib/httpd/modules/libphp5.so -t shlib_t
# ls -alZ /usr/lib/httpd/modules/libphp5.so
-rwxr-xr-x  root     root     root:object_r:shlib_t            /usr/lib/httpd/modules/libphp5.so



QUOTE:
# service httpd restart
Stopping httpd:                                            [FAILED]
Starting httpd: Syntax error on line 191 of /etc/httpd/conf/httpd.conf:
Cannot load /usr/lib/httpd/modules/libphp5.so into server: libgd.so.2: failed to map segment from shared object: Permission denied
                                               [FAILED]   

# chcon -R -t httpd_sys_content_t /usr/lib/httpd/modules/*

# ls -alZ /usr/lib/httpd/modules/ |grep php
-rwxr-xr-x  root     root     root:object_r:httpd_sys_content_t libphp5.so