SELinux prevented httpd(usr/sbin/httpd) write access to /var/www/html/bookings/templates_c

10,287

You can allow it by using setsebool -P httpd_unified=1

Normal SELinux settings for http to work with PHP more or less properly are:

setsebool -P httpd_enable_cgi on
setsebool -P httpd_unified on
setsebool -P httpd_builtin_scripting on

Otherwise you can use

getsebool -a | grep httpd

To get a list of httpd-related EeLinux options and tweak to your personal taste.

Share:
10,287
AssamGuy
Author by

AssamGuy

Updated on July 25, 2022

Comments

  • AssamGuy
    AssamGuy almost 2 years

    I am using a framework which uses Smarty template engine. It works fine in Windows, but when I tried to run it in LAMP server, I got a message like SELinux has detected suspicious behaviour on your system. The whole error message i have attached. Please guide me what to do. Thanksimage

  • ILMostro_7
    ILMostro_7 about 10 years
    httpd_unified is not necessary in most--if not all--cases. Take a look at dan walsh's blog: security vs. usability
  • aldo.roman.nurena
    aldo.roman.nurena about 10 years
    i don't know this thing, but setsebool -P httpd_enable_cgi on did the trick