Wordpress: temporary solution for Missing Zlib issue

Here is a temporary solution for wordpress users who cannot install plugins, themes or update wp due to ‘Abort class-pclzip.php : Missing zlib extensions’ error. It may work for those who cannot wait till the system is updated with a bug fix.

You need to have your zip files ready to upload manually. The trick is that zlib is working under php 5.6 or earlier.

  1. Create a free subdomain in your account and set a PHP version to 5.6 for it.
  2. Create a php script, say unzip_script.php under htdocs of new unzip-subdomain with the following content:
    <?php
    $zip = new ZipArchive;
    $res = $zip->open('my-file-name.zip');
    if ($res === TRUE) {
      $zip->extractTo('./');
      $zip->close();
      echo 'File unzipped';
    } else {
      echo 'Error!';
    }
  1. For extra security put an empty index.html file to htdocs or modify .htaccess.

  2. Using Online File Manager upload your zip file(s) to your unzip-subdomain’s htdocs. Change the filename in php script to your uploaded zip. Run php script in your browser. When unzip process is finished, it reads ‘File unzipped’.

  3. With Online File Manager ‘Copy’ the resulting unzipped directory and ‘Paste’ it to the needed place, say ‘wp-content/plugins’ of your domain or subdomain where Php 7.4 is installed.

  4. All you need then is to activate new plugin in your wp-admin.

Follow similar procedures in updating themes, or other resources.

Hope this helps…

4 Likes

This topic was automatically closed 15 days after the last reply. New replies are no longer allowed.