解决cannot restore segment prot after reloc: Permission denied
今天给php编译完ZendOptimizer,重启php-fpm,出现下列提示:"cannot restore segment prot after reloc: Permission denied",以为是selinux没有放过httpd_disable_trans,使用setsebool -P httpd_disable_trans 1命令,让selinux放过web server的控制,重启nginx后,执行php -v发现没有解决问题,就网上搜了下,下面把方法分享给大家:
1.编辑/etc/selinux/config,找到这段:
# This file controls the state of SELinux on the system. # SELINUX= can take one of these three values: # enforcing - SELinux security policy is enforced. # permissive - SELinux prints warnings instead of enforcing. # disabled - SELinux is fully disabled. SELINUX=enforcing
把 SELINUX=enforcing 注释掉:#SELINUX=enforcing,然后新加一行为:
SELINUX=disabled
2.如果关闭selinux还是不行或者不想关闭selinux的话,那可以执行下面的命令:
chcon -t texrel_shlib_t /路径/路径/名字.so (这个文件视具体执行文件)
通过上面两步可以解决php的cannot restore segment prot after reloc: Permission denied问题.
评论: