0

I'm trying to update to the latest (5.7.2) version of Wordpress from a fresh installation on CentOS 7, however I keep getting the error message

Could not copy file.: wp-admin/images/about-color-palette-vert.svg

This file is a new file added in 5.7.2 which does not exist in my current version.

The entire contents of /var/www/html is owned by apache:apache and even with everything set to 777 I still get this error message. Yes, I read the old questions on this. Even Wordpress itself thinks that its file permissions are correct!

I'm using PHP 7.4.19 and Apache 2.4.6. SELinux is enabled. Wordpress is running behind a proxy server which also handles SSL termination. Wordpress can perform loopback requests through the proxy and site health is good, barring warnings about updates.

Mourndark
  • 159
  • 3
  • 14

1 Answers1

0

As with many things CentOS, SELinux is the culprit! It blocks the httpd user from writing anything to the file system be default. This can be change with the following command

sudo chcon -t httpd_sys_rw_content_t /var/www/html/ -R

which allows the httpd user (in my case, apache) to read and write files in /var/www/html, and allows Wordpress to update itself.

Mourndark
  • 159
  • 3
  • 14