Driver FixRecommendedSound, Wi-Fi or graphics acting up? Check drivers firstFind missing or outdated drivers fast.Check DriversHalloween DealsAmazon USHalloween week deals: useful picks before month-endAmazon US: current deals, useful picks and tech finds.Check DealsWindows FixRecommendedWindows errors stealing your time? Find the fix fastScan stability, cleanup and performance issues.Fix Now×
Skip to content
Redmond desk12 min

How to Fix PHP ZipArchive Missing or Disabled on Windows, Linux, CLI, and Web Servers

A practical, runtime-first guide to fixing missing or disabled PHP ZIP support, including Windows PHP 8.2+, Linux builds, PHP-FPM, containers, Composer, and shared hosting.
Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

If PHP reports Class ZipArchive not found, Composer says the ZIP extension is missing, or a ZIP-related call fails, fix the PHP runtime that is actually executing the command or serving the request. Find that runtime’s active php.ini, install or enable ZIP for its PHP version and build, restart the relevant service, and verify that both the ZIP module and ZipArchive class are available.

CLI PHP, Apache, PHP-FPM, containers and hosted control panels can use different PHP binaries and configuration files. A successful php -m check therefore does not prove that a website has ZIP enabled.

As an Amazon Associate I earn from qualifying purchases.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

What the ZipArchive error means

PHP’s ZIP extension provides transparent reading and writing of ZIP archives and exposes the ZipArchive class. Errors such as Class ZipArchive not found, Call to undefined method for a ZIP operation, or Composer’s warning that the ZIP extension is missing mean that the PHP process running the application cannot use that extension.

The cause is usually one of four conditions:

  • ZIP is not installed for the PHP build.
  • ZIP is installed but not enabled in the active php.ini.
  • The extension cannot load because its directory, dependent libraries or build type do not match PHP.
  • You enabled ZIP for CLI PHP while the website runs a different web-server PHP runtime.

On PHP for Windows, the change in PHP 8.2 is especially important: php_zip.dll must be enabled in php.ini; before PHP 8.2, ZIP was built in and did not require this explicit step.

Identify the PHP runtime that fails

Do this before installing anything. Run diagnostics in the same context as the failure: a terminal for a CLI command, a temporary diagnostic page for a website, the PHP-FPM pool used by the site, or the container in which the application runs.

CLI diagnostics

  1. Check the binary and version:
    php -v
  2. Display the configuration files PHP is using:
    php --ini

    Record the “Loaded Configuration File” path. If it says no configuration file, PHP is running with defaults or an explicitly supplied configuration.

  3. Check whether ZIP is listed among loaded modules:
    php -m

    On systems with many modules, filter the output with the shell tools available on that system.

  4. Ask PHP directly about the class and build details:
    php -r "var_dump(PHP_SAPI, PHP_VERSION, PHP_OS_FAMILY, PHP_INT_SIZE, PHP_ZTS, ini_get('extension_dir'), class_exists('ZipArchive'));"

    A final value of true confirms that the CLI process can instantiate the class. PHP_ZTS distinguishes a thread-safe build from a non-thread-safe build, and PHP_INT_SIZE helps reveal a 32-bit versus 64-bit mismatch.

Web-server diagnostics

Create a temporary file in the document root containing:

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
<?php phpinfo();

Open it through the same URL that serves the failing application. Find Loaded Configuration File, extension_dir, the PHP version, architecture and thread-safety/build information, then look for a zip section. Delete the file immediately after checking it; a public phpinfo() page exposes extensive server details.

If the web page shows a different PHP version or configuration path from php --ini, that difference explains why changing the CLI configuration had no effect on the site.

Fix ZIP on Windows

PHP 8.2 and newer

  1. Find the PHP installation used by the failing process and open the php.ini identified by php --ini or the web server’s phpinfo() output.
  2. Confirm that php_zip.dll exists in the configured extension directory, normally the PHP ext folder.
  3. Enable ZIP in that active configuration. Depending on the PHP package, the directive is commonly extension=zip or an equivalent DLL directive such as extension=php_zip.dll. Do not enable a file that is absent or belongs to another PHP installation.
  4. Save php.ini.
  5. Restart the component that loads PHP: Apache, IIS, PHP-FPM, or the relevant development server. Closing and reopening a terminal is also useful after changing the CLI installation.
  6. Run php -m for CLI, or reload the temporary phpinfo() page for the web runtime. A ZIP section and a successful class_exists('ZipArchive') check confirm the change.

The explicit DLL step is required from PHP 8.2 onward because ZIP is no longer automatically available simply because the Windows PHP package is present.

When Windows says it cannot load php_zip.dll

A startup warning such as “Unable to load dynamic library” is not fixed by repeatedly editing the same line. Check the items that determine whether a Windows extension can load:

What’s actually slowing this PC down?

Pick the symptom - the matching free tool is one click away.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
  • extension_dir: It must point to the directory containing the intended php_zip.dll, not an older PHP installation.
  • Dependent DLLs: ZIP and its supporting libraries must be available in locations Windows can load. Read the complete startup warning or PHP error log for the missing filename.
  • PHP version: The extension must be built for the same PHP major and minor version as the executable.
  • Architecture: A 64-bit PHP process needs a compatible 64-bit extension; a 32-bit process needs the corresponding 32-bit build.
  • Thread safety: Thread-safe and non-thread-safe builds are different. Match the extension to the PHP build shown by phpinfo() or php -i.
  • Duplicate installations: PATH order can make php in a terminal point to a different directory than the web server’s PHP module.

After correcting one of these conditions, restart PHP and inspect the startup output again. The Windows extension guidance identifies the DLL location, dependent DLLs, extension_dir and compile-time setting mismatches as common causes.

Fix ZIP on Linux

Use a distribution package when possible

Install the ZIP-enabled PHP package that matches the PHP version used by the application. Package names differ between Debian/Ubuntu, DNF-based distributions, Alpine, Arch and other systems, and they also differ when several PHP versions are installed. Select the package from your distribution’s PHP repository rather than copying a command intended for another distribution or version.

After the package installation:

  1. Run php --ini and php -m in the CLI environment.
  2. Restart the PHP handler used by the website, such as the appropriate PHP-FPM service or Apache module.
  3. Reload the application and confirm ZIP in the web runtime’s phpinfo() output.

Some distributions place module configuration in a directory included by the main php.ini; others use versioned configuration trees. The decisive test is the loaded module list and configuration path of the failing runtime, not the presence of a package alone.

Rank #2
Dell Latitude 5420 14" FHD Business Laptop Computer, Intel Quad-Core i5-1145G7, 16GB DDR4 RAM, 256GB SSD, Camera, HDMI, Windows 11 Pro (Renewed)
  • 256 GB SSD of storage.
  • Multitasking is easy with 16GB of RAM
  • Equipped with a blazing fast Core i5 2.00 GHz processor.

Compile PHP with ZIP support

If you build PHP from source, configure it with ZIP support:

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
./configure --with-zip

For PHP 7.4 and later, the build can use a system libzip by specifying its installation directory:

./configure --with-zip --with-libzip=DIR

Replace DIR with the actual libzip prefix on the build host. The PHP build documentation requires libzip 0.11 or newer; version 0.11.2 or later is recommended by the manual. The build needs the development files, not merely a runtime library, so a system that can run an existing ZIP-enabled PHP may still lack what a source build requires.

Once the build is installed, make sure the web server and CLI point to the new PHP installation. Restart the PHP handler, then verify the module in both contexts. If the build reports that libzip is unavailable, install a compatible development package or point --with-libzip to the correct prefix before rebuilding.

PECL and packaged extension builds

The PHP ZIP installation documentation points to PECL as an installation route, and PECL publishes ZIP extension builds for Windows. Use PECL or another packaged build only when it matches the running PHP version, operating-system architecture and thread-safety mode.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Installing a matching binary is only part of the process. Enable it in the active configuration, restart the PHP process that will use it, and verify the resulting module list. A PECL extension installed for one PHP executable is invisible to another executable unless that runtime uses the same extension directory and configuration.

Containers, PHP-FPM and deployment pipelines

In a containerized application, install or enable ZIP inside the image that runs PHP. Installing a module on the host does not change an already-built container. Rebuild the image after changing its PHP packages or configuration, restart the container, and run the diagnostic commands inside it.

PHP-FPM workers read configuration when they start. Editing a mounted php.ini without restarting the pool leaves existing workers unchanged. Restart the specific FPM service or deployment that owns the site, then inspect the site through HTTP rather than relying only on a shell inside another container.

For automated deployments, include a verification step such as:

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Rank #3
php -r "if (!class_exists('ZipArchive')) { fwrite(STDERR, 'ZipArchive is unavailable'.PHP_EOL); exit(1); }"

This causes a build or release to fail before an application reaches production without the required class.

Managed and shared hosting

On managed hosting, you may not have permission to edit php.ini, install extensions or restart the PHP handler. Ask the provider or server administrator to enable ZIP for the exact web PHP version assigned to the domain. Include the PHP version, the error text, whether the failure occurs in a web request or a scheduled/CLI task, and the configuration path shown by diagnostics.

If the provider offers multiple PHP versions, changing the domain’s PHP version can change both the active configuration and the available modules. Verify the selected version after any control-panel change. If the account cannot control modules, the practical alternatives are provider-side enablement or a hosting environment where administrators can install the required extension.

Composer: ZIP extension versus unzip or 7z

Composer can use PHP’s ZipArchive class, and it may also use an operating-system archive utility. Therefore a Composer message mentioning both the ZIP extension and unzip/7z can describe two separate capabilities:

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
  • PHP ZIP: The PHP process running Composer must load the ZIP extension. Check it with php -m and class_exists('ZipArchive') in that same terminal.
  • External extractor: The operating system must provide a usable unzip or 7z executable if Composer needs an external tool. Installing an external utility does not create the PHP class.

After enabling ZIP or installing the external utility, rerun the exact Composer command. If the command still fails, check which php executable Composer invokes and compare its php --ini output with the configuration you edited. A web server’s PHP settings do not automatically apply to Composer’s CLI process.

Choose the installation method that fits your environment

Method Best fit What you must control Main pitfall
Distribution package Standard Linux servers and supported PHP versions Package repositories and the PHP service Installing a package for another PHP version or handler
Source build Custom PHP builds or systems without a suitable package Compiler, development libraries, libzip and installation paths Having a runtime libzip but not the development files, or forgetting --with-zip
PECL or packaged binary Supported prebuilt extension installations A matching PHP version, architecture and thread-safety mode Installing into a different executable’s extension directory
Container image Reproducible application deployments Dockerfile or image build and container restart Changing the host while leaving the PHP image unchanged
Managed hosting Accounts without server administration Provider support or a plan with module control Enabling ZIP for CLI while the domain uses another web PHP version

The operating system, PHP version, runtime, installation method and administrative permissions determine whether the remedy is a configuration edit, package installation, source rebuild, image rebuild or provider request. There is no single universal command that is safe across Debian/Ubuntu, DNF-based distributions, Alpine, Arch, macOS and Windows.

Runtime and compatibility checklist

Before declaring the problem fixed, record these values for every context that runs the application:

  • PHP major and minor version.
  • Operating-system family and process architecture.
  • CLI, Apache module, PHP-FPM, container or hosted runtime.
  • Loaded configuration file and any additional scanned configuration directory.
  • extension_dir and the actual location of the ZIP binary.
  • Thread-safe versus non-thread-safe build status on Windows.
  • Whether zip appears in the loaded module list and whether class_exists('ZipArchive') returns true.

Comparing this checklist between CLI and HTTP often exposes the mismatch faster than changing settings repeatedly. If one value differs, apply the repair to that runtime rather than the one that merely happens to be in your shell PATH.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Verify the repair in the original application

  1. Confirm the module in the relevant runtime: php -m for CLI or the web runtime’s temporary phpinfo() page.
  2. Confirm the class directly with class_exists('ZipArchive').
  3. Restart the service or process that loads PHP after every configuration or package change.
  4. Rerun the command, Composer operation, framework task or HTTP request that originally failed.
  5. Remove temporary diagnostics and check the PHP error log for startup warnings.

A ZIP entry in CLI output is not sufficient when the website still fails; the web process may use another binary, configuration file, extension directory or PHP-FPM pool.

Rank #4
Windows 11 Laptop with i3 Processor 15.6" Work Laptop for College Students
  • 【Efficient Performance】 Powered by Intel Core i3 processor (2 cores, 4 threads, up to 3.4GHz) with 12GB RAM and 256GB SSD. Handles multitasking, office software, online classes, and HD video streaming smoothly. Integrated Intel UHD Graphics 620
  • Backlit Keyboard & Complete Package】Comes with a cool backlit keyboard. Comes with awebcam, dual stereo speakers (8Ω/1.0W each), DC charger, and user manual – ready for late-night studying, online classes, video conferencing, and daily productivity
  • 【Vibrant Display】 15.6-inch Full HD (1920x1080) anti-glare screen with 16:9 aspect ratio delivers crisp images and vivid colors – perfect for studying, watching lectures, or entertainment. Thin-bezel design maximizes viewing area
  • 【Fast Connectivity & Expansion】 Equipped with WiFi 6 (802.11ax) and Bluetooth 5.2 for stable, high-speed wireless. Features 3 x USB 3.0, HDMI 2.1, Type-C (supports PD3.0 fast charging), and a TF card slot expandable up to 2TB – easily connect external monitors, mice, drives, or expand storage for all your files
  • 【Long Battery Life & Portable】 Built-in 11.55V 5000mAh/57.75Wh high-capacity battery delivers approximately 7 hours of mixed-use battery life – enough for a full day of classes and assignments. Lightweight at just 1.63kg (3.6 lbs) and 19.5mm thin, plus a compact packing size – easily slips into a backpack for campus, library, or coffee shop

Troubleshooting matrix

Symptom Likely cause Evidence-led action
Class ZipArchive not found ZIP is not loaded in the executing runtime. Identify that runtime’s php.ini, install or enable ZIP, restart it, and verify the class.
php -m shows zip, but the website fails CLI and web PHP use different binaries or configuration files. Inspect the web runtime with phpinfo(), change its configuration, restart the web handler, and test again.
Windows warns that php_zip.dll cannot load Wrong extension_dir, missing dependency DLL, or PHP architecture/thread-safety/version mismatch. Check the DLL path, dependent files, build settings and startup logs.
Linux source build says libzip is missing The compatible libzip development files are unavailable or the build cannot find them. Install a compatible system libzip development package or provide its prefix with --with-libzip, then rebuild with --with-zip.
Shared hosting prevents configuration changes The account lacks permission to install or enable PHP modules. Ask the host to enable ZIP for the web PHP version or move to an environment with extension control.
Composer still mentions ZIP after a fix Composer is using another CLI PHP, or it also needs an external extractor. Check Composer’s PHP executable, verify ZipArchive there, and provide unzip or 7z if required.

Prevent the problem from returning

  • Record the PHP version, architecture, thread-safety mode, extension directory and active configuration for each deployment target.
  • Keep CLI, FPM and web-server PHP versions aligned when an application expects the same extensions in every context.
  • After PHP upgrades, verify that ZIP remains enabled; Windows PHP 8.2 and newer requires the explicit php_zip.dll configuration.
  • Add a deployment check for class_exists('ZipArchive') before running migrations, dependency installation or archive-processing jobs.
  • Do not leave phpinfo() or diagnostic scripts publicly accessible.

Frequently Asked Questions

How do I enable ZipArchive in PHP?

Find the php.ini used by the failing runtime, install a ZIP-enabled PHP package or confirm php_zip.dll exists, enable it, restart the PHP handler, and verify both the zip module and ZipArchive class.

Why does php -m show zip while my website says the class is missing?

CLI PHP and web PHP commonly use different binaries, versions or configuration files. Check the website with a temporary phpinfo() page and enable ZIP in that runtime’s active configuration.

Do I need to enable php_zip.dll on every Windows PHP installation?

For PHP 8.2 and newer, enable php_zip.dll in the active php.ini. The extension was built in before PHP 8.2, but separate installations can still have different configurations.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

What causes “Unable to load dynamic library php_zip.dll”?

Check extension_dir, missing dependent DLLs, PHP major and minor version, 32-bit versus 64-bit architecture, and thread-safe versus non-thread-safe build matching. Read the startup warning or PHP log for the exact missing file.

What libzip version is required for a source build?

The PHP build documentation requires libzip 0.11 or newer and recommends 0.11.2 or later. Install the development files and configure PHP with --with-zip, adding --with-libzip=DIR when needed.

Why does Composer mention both ZIP and unzip or 7z?

Those are separate capabilities. Composer needs PHP’s ZipArchive class or a usable external extractor, depending on the operation. Check the CLI PHP that Composer invokes and install unzip or 7z separately if required.

Can I fix ZIP on shared hosting without shell access?

Only if the control panel exposes the module setting. Otherwise ask the provider to enable ZIP for the domain’s exact web PHP version or move to a plan where administrators can install extensions.

Free tools Windows power users keep installed

One-click scans. No signup required.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Why does changing php.ini not fix PHP-FPM immediately?

PHP-FPM workers read configuration when they start. Restart the specific FPM pool or deployment, then test through HTTP with the web runtime rather than relying on a shell process.

The Bottom Line

Fix ZipArchive in the runtime that actually fails: identify its PHP binary and active php.ini, install or enable ZIP with a matching build, restart the handler, and verify zip plus class_exists('ZipArchive'). Treat CLI, web-server PHP, FPM, containers and hosted accounts as separate runtimes until proven otherwise.

Quick Recap

Bestseller No. 1
Bestseller No. 2
Dell Latitude 5420 14' FHD Business Laptop Computer, Intel Quad-Core i5-1145G7, 16GB DDR4 RAM, 256GB SSD, Camera, HDMI, Windows 11 Pro (Renewed)
Dell Latitude 5420 14" FHD Business Laptop Computer, Intel Quad-Core i5-1145G7, 16GB DDR4 RAM, 256GB SSD, Camera, HDMI, Windows 11 Pro (Renewed)
256 GB SSD of storage.; Multitasking is easy with 16GB of RAM; Equipped with a blazing fast Core i5 2.00 GHz processor.
$285.00
Bestseller No. 3
HP 14' HD Laptop, Windows 11, Intel Celeron Dual-Core Processor Up to 2.60GHz, 4GB RAM, 64GB SSD, Webcam, Dale Pink (Renewed)
HP 14" HD Laptop, Windows 11, Intel Celeron Dual-Core Processor Up to 2.60GHz, 4GB RAM, 64GB SSD, Webcam, Dale Pink (Renewed)
14" diagonal, 1366x768 resolution, HD BrightView LED, Glossy NON-TOUCH Display
$245.99

Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.

Leave a Reply

Your email address will not be published. Required fields are marked *

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

More from the Wire

  1. World desk4 min
    How to Spot an AI Voice Scam Before Sending MoneyDon’t rely on how a caller sounds. Pause, call back through a known number, and verify the emergency with another trusted person before sending money.
  2. Mountain View desk4 min
    Google’s SynthID Detector: How to Check AI-Generated Images, Video and AudioGoogle’s SynthID Detector looks for an embedded watermark in supported images, video and audio. Here is what its results do—and do not—show.
  3. Redmond desk20 min
    How to create a link to File or Folder in Windows 11Windows 11 gives you several ways to point to a file or folder without moving or duplicating it. You can create a desktop shortcut,…
Recommended PC Tool
Recommended PC Tool
Crashes, No Sound, or Screen Glitches?Free driver scan
PC Slower Than It Used to Be?Free scan - under a minute

Two free Windows tools

One Free Minute Could Fix That PC

Before you go - each of these free tools takes about a minute and tackles what quietly slows a Windows PC down.

Special offer. View Outbyte info, uninstall instructions, EULA, and Privacy Policy.