My VPS is running with CentOS 8. I installed there Wordpress for my website. After finishing setup of my website, I cannot download/update plugin or theme. I got a solution by disabling SELinux for permanently.But, it's really an idiotic work. Here is a log file of SELinux alert.

I cannot understand, should I allow these things? LOGS: SELinux is preventing /usr/sbin/php-fpm from using the execmem access on a process. SELinux is preventing /usr/sbin/php-fpm from write access on the directory wp-content. SELinux is preventing /usr/sbin/php-fpm from name_connect access on the tcp_socket port 80.

I just tried one of them to solve: SELinux is preventing /usr/sbin/php-fpm from write access on the directory wp-content.

by semanage fcontext -a -t httpd_sys_rw_content_t '/path/wp-content'

restorecon -v 'path/wp-content'

But after, allowing this, still I'm getting SElinux preventing error. Nothing solve for my site. I also tried by allowing main directory of my website/Wordpress by using semanage as well as chcon. Nothing happened good. Did I do anything worn? or what should I do now to solve SELinux permission error for my website.

It'll be grateful for me if I'll get help from you.

  • I am just here to watch. Hope someone can answer this question. I usually fight with SELINUX on CentOS to get minimal functionality. Often turning it off; which is probably not the best approach. LOL :P Jul 11, 2020 at 23:24

1 Answer 1


Your restorecon command is missing the -R flag for recursion, that's why it didn't work.

When you ran restorecon -v 'path/wp-content', the httpd_sys_rw_content_t context only applied to the wp-content directory itself, not its contents - namely here the plugins and themes subdirectories - that's why they remained unwritable.

To fix it, just run restorecon -Rv 'path/wp-content'.

For more information:

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.