Ask Your Question

Wordpress can't create files, pages or posts if SElinux is enabled, FS 29

asked 2018-12-31 02:41:14 -0500

Tarik gravatar image

updated 2018-12-31 02:58:24 -0500


I did a web server on Cloud Server using Fedora Server 29 + Latest Apache + Latest PHP + Latest MariaDB + latest Wordpress from it's website.

If I disable SELinux the new website works perfect but if I enable it the Wordpress can't create pages or posts, also I can't access the plugins and themes market, is there any way to enable SELinux without problem in Wordpress?


edit retag flag offensive close merge delete


We need more information. See . Errors, AVC, audit2why .....

Panther gravatar imagePanther ( 2018-12-31 08:00:28 -0500 )edit

1 Answer

Sort by ยป oldest newest most voted

answered 2018-12-31 14:53:18 -0500

aeperezt gravatar image

To make workpress upload files when working with SELinux you need to do this:

chcon -R -t httpd_sys_content_rw_t /var/www/html/your_wordpress_dir/wp-content/uploads/

You should also do this to allow to connect to the db use the network and send emails if you wordpress require it:

sudo setsebool -P httpd_can_network_connect_db 1
sudo setsebool -P httpd_can_network_connect 1
sudo setsebool -P httpd_can_sendmail 1

If you are hosting it on a home folder then there are other steps that need to be done.

Good Luck.

edit flag offensive delete link more


Thank you very much my dear.

Tarik gravatar imageTarik ( 2019-01-01 10:54:51 -0500 )edit

Thank you for the solution.

davisclick gravatar imagedavisclick ( 2019-02-25 12:47:52 -0500 )edit

Question Tools

1 follower


Asked: 2018-12-31 02:41:14 -0500

Seen: 150 times

Last updated: Dec 31 '18