• Resolved nickb94

    (@nickb94)


    I can almost hear you thinking: another noob having trouble with setting permissions. Well, that’s not the case here.

    I am running a wordpress multisite setup on a Plesk server with Debian Buster. I just migrated this website and everything is running smoothly.

    However: as soon as I try to update plugins, I get the message “Update Failed: Could not create directory”. Also, the following message gets logged:
    PHP message: PHP Warning: file_exists(): open_basedir restriction in effect. File(/var/www/vhosts/business.eu/httpdocs/wp-content/upgrade/akismet.4.2.1-giPwTp/) is not within the allowed path(s): (/var/www/vhosts/business.eu/httpdocs/:/tmp/) in /var/www/vhosts/business.eu/httpdocs/wp-admin/includes/class-wp-filesystem-direct.php on line 390. As you can see, the path is IN the open_basedir setting. Yet it logs it as a violation of the restriction. Strange, huh?

    If I disable the open_basedir restrictions. The error stays but nothing gets logged anywhere. I have confirmed that I can write to the wp-content/ directory with the user that executes php files.

    What’s going on here? Does anyone have any experience with this?

Viewing 2 replies - 1 through 2 (of 2 total)
  • Moderator bcworkz

    (@bcworkz)

    The file_exists() call at line 390 is related to a delete request. There is not any attempt to create a directory there. The message and log entry are apparently unrelated. That’s why the error remains and nothing is logged when you disable open_basedir.

    Now, the open_basedir restriction may be causing the delete request to fail, but that’s a separate issue. It seems we don’t know where the directory creation failed. But if the entire WP structure is owned by the PHP user, as it should be, creating directories shouldn’t be a problem if permissions are correctly set to start with. But it sounds like you checked all that. More investigation is needed, but that logged PHP warning appears to be a red herring (misleading and not useful). All we can say at this point is there is a server configuration issue somewhere.

    Thread Starter nickb94

    (@nickb94)

    I figured it out. I don’t know the technical details, but the site I migrated was previously hosted at Flywheel. In the wp-content directory were a couple of files and directories (ai8wm-backup, db-connection.php and a 0-byte upgrade file) that were causing trouble. After removing these files, the upgrade succeeded.

    Figured I might post this to help someone in the future.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Update Failed: Could not create directory’ is closed to new replies.