How to Fix PCLZIP_ERR_BAD_FORMAT (-10): Invalid archive structure in WordPress

How to Fix PCLZIP_ERR_BAD_FORMAT (-10): Invalid archive structure in WordPress

Are you experiencing the PCLZIP_ERR_BAD_FORMAT (-10): Invalid archive structure error when updating themes or plugins in WordPress? Don't worry, you can try the tutorial on this page to resolve the issue.

The PCLZIP_ERR_BAD_FORMAT (-10): Invalid archive structure error occurs more frequently if you are using NGINX on your server and have not created a temporary folder, though it rarely happens if you are using Apache.

How to Fix PCLZIP_ERR_BAD_FORMAT (-10): Invalid archive structure

For this tutorial, we are attempting to fix the issue using cPanel. If you are using a LAMP stack, the method is the same, but you will need to perform it via SSH.

1. Create a Temporary Folder

Open the WordPress installation folder you are using, then add a folder named temp inside wp-content

Also, ensure that the folder you created uses 755 permissions. If you are using SSH, you can use the following command once you are inside the WordPress installation folder

mkdir wp-content/temp; chmod 755 wp-content/temp; chown www-data:www-data wp-content/temp

2. Update WordPress Configuration

Now you need to edit the wp-config.php file in your WordPress installation and add the following line above the line /* That's all, stop editing! Happy publishing. */

define('WP_TEMP_DIR', ABSPATH . 'wp-content/temp/');

After adding that line, you can save the changes to the wp-config.php file

3. Update Plugins and Themes

Once the changes are saved, you can update the plugins or themes that were previously experiencing the PCLZIP_ERR_BAD_FORMAT (-10): Invalid archive structure error, and the issue should now be resolved.

However, if the error still occurs, it is recommended to check if the zip file being used is password-protected or corrupted, because if the file is corrupted and encrypted, it is highly likely that the file cannot be extracted and will trigger that error.

Written by

Muhammad Khoirun Nasikin

I enjoy tinkering with WordPress, hosting, VPS, web development, and various small experiments related to websites. I have over 3 years of experience in the web hosting industry.

COMMENTS

Loading...