WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] Automatic update ended with "Plugin contains no files" but the files are there (8 posts)

  1. Hinjiriyo
    Member
    Posted 1 year ago #

    Hello Coders, on a new server I tried to update plugins via the automatic update of WordPress,

    Downloading the plugin: worked.
    Unpacking: worked.
    Installing: was in progress.
    Then: "Plugin update failed."
    Reason: "The plugin contains no files."

    The plugin folder was set to 777.

    The unpacked plugin is in /wp-content/upgrade/{plugin-name}.tmp. Folder "upgrade" was set to 777.

    The folder contained all files of the plugin.

    But the message "no files" still appears.

    I couldn't figure out the reason. Does anybody here have a hint?

  2. Hinjiriyo
    Member
    Posted 1 year ago #

    I got it.

    The provider set a php env variable "upload_tmp_dir". WP uses this path as value for WP_TEMP_DIR, the tmp folder. Maybe some permission issues were the reason. Unfortunately the provider offers no support for third-party applications like WP.

    I changed the path in the wp-config.php with:
    putenv('TMPDIR='. ABSPATH .'tmp');
    define('WP_TEMP_DIR', ABSPATH . 'tmp');
    with /tmp set to 777.

    In addition with this in the wp-config.php:
    define('FTP_BASE', '/root');
    define('FTP_CONTENT_DIR', '/root/wp-content');
    define('FTP_PLUGIN_DIR', '/root/wp-content/plugins');

    Without these lines the upgrade process didn't start, just said "all files are up to date."

    Now every upgrade works.

  3. Hinjiriyo
    Member
    Posted 1 year ago #

    marked as resolved

  4. Hbecton
    Member
    Posted 1 year ago #

    So this is a general solution to this problem? Do I simply paste the code you have given inside the specified file?

  5. Hinjiriyo
    Member
    Posted 1 year ago #

    Whether a "general solution" - I don't know. Just try it if you have the same problem.

    Just pasting the code is not enough. You have to create a folder "tmp" in the wordpress root and chmod it to 777. And you should change the string "root" to the absolute path of the wordpress root.

  6. XL64
    Member
    Posted 1 year ago #

    How did you notice upload_tmp_dir was set ? How can I see if my issue is the same ?

    XL.

  7. XL64
    Member
    Posted 1 year ago #

    Thanks, was the same for me, only created the tmp folder and pasted :
    putenv('TMPDIR='. ABSPATH .'tmp');
    define('WP_TEMP_DIR', ABSPATH . 'tmp');

    The FTP thing was not needed for me.

    Unlike yours, my {plugin-name}.tmp folder was empty.

  8. Hinjiriyo
    Member
    Posted 1 year ago #

    HI XL, I found upload_tmp_dir via phpinfo().

Topic Closed

This topic has been closed to new replies.

About this Topic