HostOnNet Blog

libphp5.so: cannot enable executable stack as shared object requires: Permission denied

On starting Apache, i got following error

[root@localhost apache2]# service httpd restart
Stopping httpd:                                            [FAILED]
Starting httpd: httpd: Syntax error on line 210 of /etc/httpd/conf/httpd.conf: Syntax error on line 6 of /etc/httpd/conf.d/zendserver_php.conf: Cannot load /usr/local/zend/lib/apache2/libphp5.so into server: /usr/local/zend/lib/apache2/libphp5.so: cannot enable executable stack as shared object requires: Permission denied
                                                           [FAILED]
[root@localhost apache2]#

This is because SELinux. You need to disable it by editing /etc/selinux/config

vi /etc/selinux/config

Find

SELINUX=enforcing

Replace with

SELINUX=disabled

Restart server.

You can disable selinux run time with command “setenforce 0”, this will be lost on reboot, so you need to edit /etc/selinux/config for disabling permanently.

[root@localhost apache2]# setenforce 0
[root@localhost apache2]# service httpd start
Starting httpd:                                            [  OK  ]
[root@localhost apache2]#

Posted in Apache

  • Raffael

    It would be better if selinux is running. In order to solve the problem for real you should follow these steps:
    http://www.crypt.gen.nz/selinux/faq.html#CP.19

  • Mark Tinsley

    Agreed. This advice = bad.

  • Mark Tinsley

    This comment was helpful. For me it was the httpd_execmem bool:
    $ setsebool httpd_execmem on