How to update WordPress with SELinux enabled

What is SELinux?

Start Hacking SELinux

$ sudo chown nginx:nginx -R /path/to/wordpress
$ sudo find /path/to/wordpress -type f -exec chmod 0644 {} \;$ sudo find /path/to/wordpress -type d -exec chmod 0755 {} \;
$ ls -Z
drwxr-xr-x. nginx nginx system_u:object_r:httpd_sys_content_t:s0 wordpress
$ sudo chcon -t httpd_sys_content_t /path/to/wordpress -R
$ sudo chcon -t httpd_sys_rw_content_t /path/to/wordpress/wp-config.php$ sudo chcon -t httpd_sys_rw_content_t /path/to/wordpress/wp-content -R
$ sudo chcon -t httpd_sys_rw_content_t /path/to/wordpress/nginx.conf

Troubleshooting

define('FS_METHOD', 'direct');

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store