If you are having trouble updating your Wordpress plugin with KUSANAGI Runs on Docker

Introduction

The Wordpress plugin and core version upgrade failed, and when I was looking for the cause, I found that it could be avoided by changing the folder permissions. I will summarize the procedure.

Wordpress plugin version upgrade fails

When I try to update the plug-in in the standard KUSANAGI Runs on Docker environment, the error "Update failed: The directory could not be created" appears and the version upgrade fails. img09.JPG

The cause is the permission of the folder

Kusanagi RoD is usually installed in any folder under / home/kusanagi. The permission of the folder at that time is 755, which seems to be the cause. When upgrading, temporarily change the folder permissions to 777. By the way, change the file permissions to 666.

# cd /home/kusanagi/puroject
# find . -type d -exec chmod 777 {} +
# find . -type f -exec chmod 666 {} +

Now the permissions have changed.

# ls -al
total 28
drwxrwxrwx    6 kusanagi 1001          4096 Aug  5 05:54 .
drwxr-x--x    3 kusanagi 1001          4096 Oct 11 03:31 ..
drwxrwxrwx    5 kusanagi 1001          4096 Dec 20 14:25 DocumentRoot
drwxrwxrwx    2 kusanagi 1001          4096 Jul 16 10:24 settings
drwxrwxrwx    2 kusanagi 1001          4096 Aug  5 05:54 tools
drwxrwxrwx    4 kusanagi 1001          4096 Jul 16 10:24 wp-config-sample
-rw-r--r--    1 kusanagi 1001          3351 Oct 11 03:44 wp-config.php

Upgrade again

This time it was successful! img10.JPG

Don't forget to restore the permissions as it is loose for security. Although it is described in another entry, if you do not set the uploads folder to 775, image upload will fail, so update this as well.

# find . -type d -exec chmod 777 {} +
# find DocumentRoot/wp-content/uploads -type d -exec chmod 775 {} +

Recommended Posts

If you are having trouble updating your Wordpress plugin with KUSANAGI Runs on Docker
If you have trouble uploading Wordpress image files with KUSANAGI Runs on Docker
If you get stuck with PHPStorm and xdebug on docker. trouble shooting
Update container image with KUSANAGI Runs on Docker
WordPress with Docker Compose on CentOS 8