![RHEL 9.1 - SELinux 阻止 /usr/local/bin/php 对文件 /web/inc/init_db.inc.php 进行读取访问](https://linux22.com/image/218749/RHEL%209.1%20-%20SELinux%20%E9%98%BB%E6%AD%A2%20%2Fusr%2Flocal%2Fbin%2Fphp%20%E5%AF%B9%E6%96%87%E4%BB%B6%20%2Fweb%2Finc%2Finit_db.inc.php%20%E8%BF%9B%E8%A1%8C%E8%AF%BB%E5%8F%96%E8%AE%BF%E9%97%AE.png)
我想按照 SELinux 所说的解决这个问题。
SELinux is preventing /usr/local/bin/php from read access on the file /web/inc/init_db.inc.php.
控制台的输出是:
[root@rhel ~]# ausearch -c 'php' --raw | audit2allow -M my-php
compilation failed:
my-php.te:15:ERROR 'syntax error' at token 'mlsconstrain' on line 15:
mlsconstrain file { ioctl read lock execute execute_no_trans } ((h1 dom h2 -Fail-) or (t1 != mcs_constrained_type -Fail-) ); Constraint DENIED
mlsconstrain file { write setattr append unlink link rename } ((h1 dom h2 -Fail-) or (t1 != mcs_constrained_type -Fail-) ); Constraint DENIED
/usr/bin/checkmodule: error(s) encountered while parsing configuration
我以前从未遇到过这个问题,我该怎么办?