Support » Fixing WordPress » Automatic update ended with "Plugin contains no files" but the files are there

  • Resolved Martin Stehle

    (@hinjiriyo)


    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?

Viewing 7 replies - 1 through 7 (of 7 total)
  • 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.

    marked as resolved

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

    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.

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

    XL.

    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.

    HI XL, I found upload_tmp_dir via phpinfo().

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘Automatic update ended with "Plugin contains no files" but the files are there’ is closed to new replies.