Support » Fixing WordPress » One or More Modules Is Missing: Zip

  • Resolved linux4me2

    (@linux4me2)


    One of my clients just let me know that in Tools > Site Health, they are seeing a message that “The optional module, zip, is not installed, or has been disabled.”

    Before you refer me to my web host, I should mention that I am the web host. : )

    Plugins can be installed both by uploading a *.zip file and through the UI, so unzip appears to be working fine.

    The site involved is running PHP 7.4 on an Interworx/CentOS 7 server, so I checked the modules (extra ones removed for readability):

    
    [#]php74 -m
    [PHP Modules]
    ...
    zip
    ...
    

    So the zip module is definitely installed and available.

    There are no errors in the error log when I run Site Health, so it’s apparently not a PHP error preventing WP from checking available modules.

    I set up a test site running a default theme and no plugins, and see the same warning about zip not being available. I can’t find a bug report on core.trac.wordpress.org for this.

    Is anyone seeing the same thing, or know of a solution?

Viewing 5 replies - 1 through 5 (of 5 total)
  • Moderator Yui

    (@fierevere)

    ゆã„

    You are checking from command line?
    This might be not your actual PHP used on your site. Different php.ini and may be even different PHP version.

    You can try with creating phpinfo.php , putting it into your site root and visiting yoursite/phpinfo.php with your browser

    <?php
    phpinfo();
    ?>
    Thread Starter linux4me2

    (@linux4me2)

    Yes, I was checking from the command line, and specified the version of PHP (7.4) that the site is using, as well as checking the system PHP version. Both show the zip module is present.

    I also tried phpinfo(), and it shows that the zip ini is loaded (40-zip.ini) as well as a listing for “Zip” in the Module Authors Section. I don’t see a specific section of phpinfo for Zip, however.

    Thread Starter linux4me2

    (@linux4me2)

    You got me thinking about how to see what extensions are loaded other than using the command line. I wrote this little PHP script to check:

    
    <!DOCTYPE html>
    <html>
    	<head>
    		<meta charset="UTF-8">
    		<meta name="viewport" content="width=device-width, initial-scale=1.0">
    		<title>Test Page</title>
    		
    	</head>
    	<body>
    		<div id="wrapper">
    			<div id="container">
    				<div id="header"><h2>Test Page</h2></div>
    				<div>
    					<?php
    					if (extension_loaded('zip')) {
    					    echo "Zip is loaded.";
    				    } else {
    				        echo "Zip is not loaded.";
    			        }
    			        echo '<br><h2>Loaded Extensions</h2>';
    			        $loaded = get_loaded_extensions();
    			        foreach ($loaded as $key=>$val) {
    			            echo $val . '<br>';
    		            }
    					?>
    				</div>
    			</div>
    		</div>
    	</body>
    </html>
    

    It shows that Zip is not loaded, so I guess there’s my answer. I still have to figure out why.

    Thread Starter linux4me2

    (@linux4me2)

    I figured out what the problem was.

    I looked at the phpinfo for the system version of PHP, and found out there should be a specific section for Zip, which the system PHP phpinfo has, but the specific versions of PHP did not. I compared the system php.ini to the PHP 7.4 php.ini, and there was no module declaration for Zip. That made me wonder if there was an update that didn’t propagate to the multi-PHP system. Looking over recent software updates, I noticed that all the Zip extensions were updated on 6/19/2021. I restarted PHP-FPM, a voila! All the warnings in WordPress Site Health are gone, there is now a Zip section in the various PHP-version-specific php.ini files, and all is good.

    Thanks for your help, @fierevere. You got me thinking in the right direction.

    Plugins can be installed both by uploading a *.zip file and through the UI, so unzip appears to be working fine.

    When the Zip module is not present, WordPress will try to use the zlib module as a fallback. I suspect that zlib is installed/enabled, which is why uploading *.zip files worked fine.

Viewing 5 replies - 1 through 5 (of 5 total)
  • You must be logged in to reply to this topic.