Fixing “Error: The package could not be installed”

If you’re unlucky, you may get the following error when you try to install plugins or import demo-content of a theme:

The package could not be installed. PCLZIP_ERR_BAD_FORMAT (-10) : Invalid archive structure

This error indicates that WordPress has not been able to successfully download and extract the latest version of the plugin or files from the server.

 

Ensuring cURL is configured on your server

The primary cause is the cURL library not working on the server, either because it has not been enabled, or is incorrectly configured.

When cURL is not available to WordPress, it falls back on other methods of retrieving the update file which appear to fail to correctly transfer the zip file (in some cases, at least), resulting in the error mentioned above.

While it is beyond the scope of this post to advise how to install cURL for all the combinations of servers and PHP versions, there are two basic things that need to be done. First, cURL needs to be installed on the webserver itself (e.g. Apache). Then the PHP cURL extension appropriate to the webserver and PHP version needs to be installed.

If you are hosting your site with a web host, they should be able to assist you with the installation of cURL / PHP cURL.

You can check if cURL is available to PHP on your server by navigating to Laborator > Systems Status area. If you have cURL installed, you should see the checkmark (✓)  next to cURL name.

2 Comments

Join the discussion and tell us your opinion.

Laboratorreply
January 8, 2020 at 10:42 am

Test comment

Laboratorreply
January 8, 2020 at 10:42 am
– In reply to: Laborator

Another test comment

Leave a reply