PHP webpage doesn't launch unix command even after updated sudoers

前端 未结 4 779
时光取名叫无心
时光取名叫无心 2020-12-11 11:29

Basically I am trying to restart a service from a php web page.

Here is the code:



        
4条回答
  •  不思量自难忘°
    2020-12-11 11:42

    I encountered the problem recently and the accepted answer above helped. However, I would like to post this answer to elaborate the same, so that the next person does not need to spend time much, like me!

    Follow section 7 of the following link: https://wiki.centos.org/HowTos/SELinux.

    Do grep with httpd_sys_script_t.

    Basically the steps are:

    # grep httpd_sys_script_t /var/log/audit/audit.log | audit2allow -M httpdallowsudo
    # semodule -i httpdallowsudo.pp
    

提交回复
热议问题