{"id":5047,"date":"2019-09-19T07:02:07","date_gmt":"2019-09-19T01:32:07","guid":{"rendered":"https:\/\/pheonixsolutions.com\/blog\/?p=5047"},"modified":"2026-10-31T12:38:30","modified_gmt":"2026-10-31T07:08:30","slug":"php-fatal-error-class-ziparchive-not-found","status":"publish","type":"post","link":"https:\/\/pheonixsolutions.com\/blog\/php-fatal-error-class-ziparchive-not-found\/","title":{"rendered":"How to Fix PHP Fatal Error: Class &#8216;ZipArchive&#8217; Not Found"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\"><strong><strong>Post Date:<\/strong><\/strong> September 19, 2019<strong><br><strong>Last Updated:<\/strong> <\/strong>October 31, 2026<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Introduction<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">When working with PHP applications, you may encounter the error <strong><a href=\"https:\/\/www.php.net\/manual\/en\/class.ziparchive.php\" target=\"_blank\" rel=\"noopener\">PHP Fatal error: Class &#8216;ZipArchive&#8217; not found<\/a><\/strong>. This error usually occurs when the PHP ZIP extension is missing, disabled, or not loaded by the PHP environment running your application.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">The <code>ZipArchive<\/code> class is part of PHP&#8217;s ZIP extension. It allows developers to create, open, extract, and modify ZIP archive files. Applications such as Laravel, WordPress, Composer, and other PHP-based platforms may depend on this extension to handle compressed files.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">This issue commonly occurs after installing PHP, upgrading to a newer PHP version, or configuring a new web server without enabling the required PHP extensions.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">In this guide, we will explain how to fix the <code>ZipArchive<\/code> class not found error by installing and enabling the PHP ZIP extension on Ubuntu, Debian, CentOS, and RHEL-based Linux servers. We will also cover PHP-FPM configuration, Apache and Nginx restarts, and troubleshooting steps to verify that the extension is working correctly.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">What Causes the PHP ZipArchive Class Not Found Error?<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">The error occurs when PHP cannot locate or load the ZIP extension required to use the <code>ZipArchive<\/code> class.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Some common reasons include:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>Missing PHP ZIP extension:<\/strong> The ZIP extension is not installed on the server.<\/li>\n\n\n\n<li><strong>Extension disabled:<\/strong> The ZIP extension is installed but not enabled in the PHP configuration.<\/li>\n\n\n\n<li><strong>Multiple PHP versions:<\/strong> The extension is installed for a different PHP version than the one used by the application.<\/li>\n\n\n\n<li><strong>PHP-FPM configuration:<\/strong> PHP-FPM is running with a configuration that does not load the ZIP extension.<\/li>\n\n\n\n<li><strong>PHP configuration mismatch:<\/strong> The CLI and web server use different PHP configurations.<\/li>\n<\/ul>\n\n\n\n<p class=\"wp-block-paragraph\">Before installing the extension, check which PHP version is currently running on your server.<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">php -v<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">To check whether the ZIP extension is enabled, execute:<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">php -m | grep -i zip<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">If the command does not return <code>zip<\/code>, the extension may be missing or disabled in the CLI environment.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">How to Install the PHP ZIP Extension on Linux<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">The solution is to install the <a href=\"https:\/\/www.php.net\/manual\/en\/zip.installation.php\" target=\"_blank\" rel=\"noopener\">PHP ZIP extension<\/a> that matches your active PHP version.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Follow the instructions below based on your Linux distribution.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">1. Install PHP ZIP Extension on Ubuntu and Debian<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">On Ubuntu and Debian-based systems, you can install the PHP ZIP extension using the APT package manager.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">First, update the package repository:<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">sudo apt update<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Install the PHP ZIP extension:<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">sudo apt install php-zip -y<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">If you are using a specific PHP version, install the corresponding package.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">For example, for PHP 8.3:<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">sudo apt install php8.3-zip -y<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">For other PHP versions:<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">sudo apt install php8.1-zip -y\nsudo apt install php8.2-zip -y\nsudo apt install php8.4-zip -y<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Note:<\/strong> Install the package matching the PHP version used by your application. Package availability depends on your Ubuntu or Debian release and configured repositories.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">2. Install PHP ZIP Extension on CentOS and RHEL<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">On CentOS and RHEL-based systems, you can install the ZIP extension using YUM or DNF.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">For older systems using YUM:<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">sudo yum install php-zip -y<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">For newer systems using DNF:<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">sudo dnf install php-zip -y<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">If you are using a third-party PHP repository or multiple PHP versions, check the package name provided by that repository before installing.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">After installation, verify that the extension is available:<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">php -m | grep -i zip<\/pre>\n\n\n\n<h3 class=\"wp-block-heading\">3. Enable the PHP ZIP Extension<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">In most package-based installations, the PHP ZIP extension is enabled automatically after installation.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">If it is installed but not enabled, you can enable it on Ubuntu and Debian using:<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">sudo phpenmod zip<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Check the PHP configuration:<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">php --ini<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">You can also inspect the extension configuration files under:<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">\/etc\/php\/<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">For PHP-FPM or Apache installations, make sure the extension is enabled in the configuration used by the relevant PHP service.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Restart Apache, Nginx, and PHP-FPM<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">After installing or enabling the extension, restart the relevant PHP service so that the new configuration is loaded.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Restart Apache<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">For Ubuntu and Debian:<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">sudo systemctl restart apache2<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">For CentOS and RHEL:<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">sudo systemctl restart httpd<\/pre>\n\n\n\n<h3 class=\"wp-block-heading\">Restart PHP-FPM<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">If your application uses PHP-FPM, restart the service corresponding to your PHP version.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">For example, PHP 8.3:<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">sudo systemctl restart php8.3-fpm<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">For other PHP versions, replace <code>8.3<\/code> with the installed version.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">On systems where the service uses a generic name:<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">sudo systemctl restart php-fpm<\/pre>\n\n\n\n<h3 class=\"wp-block-heading\">Restart Nginx<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">If Nginx is configured with PHP-FPM, restart PHP-FPM first. Nginx normally does not need restarting just because a PHP extension was installed.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">If you have also changed Nginx configuration, test and reload it:<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">sudo nginx -t\nsudo systemctl reload nginx<\/pre>\n\n\n\n<h2 class=\"wp-block-heading\">How to Verify the PHP ZIP Extension Installation<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">After installing and restarting the required services, verify that the ZIP extension is working correctly.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Step 1: Check the Installed PHP Modules<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Run:<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">php -m | grep -i zip<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Expected output:<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">zip<\/pre>\n\n\n\n<h3 class=\"wp-block-heading\">Step 2: Check the PHP ZIP Configuration<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Execute:<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">php --ri zip<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">This command displays information about the installed ZIP extension.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Step 3: Verify the ZipArchive Class<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Run the following command:<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">php -r \"var_dump(class_exists('ZipArchive'));\"<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Expected output:<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">bool(true)<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">If the output is <code>bool(true)<\/code>, the PHP CLI environment can access the <code>ZipArchive<\/code> class.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Step 4: Verify Through the Web Server<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">If the error still occurs in your website, the web server may be using a different PHP version or configuration from the CLI.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Create a temporary PHP file named <code>phpinfo.php<\/code> in your website&#8217;s document root:<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">&lt;?php\nphpinfo();<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Open the file in your browser:<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">https:\/\/your-domain.com\/phpinfo.php<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Search for the ZIP section and confirm that the extension is enabled.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Security note:<\/strong> Remove the <code>phpinfo.php<\/code> file immediately after verification because it exposes server and PHP configuration details.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Troubleshooting: ZipArchive Class Still Not Found<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">If the error continues after installing the extension, check the following issues.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">1. Check Multiple PHP Versions<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">If multiple PHP versions are installed, the extension may be enabled for a different version.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Check the active CLI version:<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">php -v<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Check the available PHP binaries:<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">ls -l \/usr\/bin\/php*<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Install the ZIP extension for the PHP version used by your application.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">2. Check PHP-FPM Configuration<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">If you are using PHP-FPM, verify that the correct PHP-FPM service is running:<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">systemctl status php8.3-fpm<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Check the loaded configuration:<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">php-fpm8.3 -i | grep -i zip<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">The PHP-FPM binary name may vary depending on your installation.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">3. Check the PHP Extension Directory<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Execute:<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">php -i | grep extension_dir<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">This displays the directory where PHP searches for extensions.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Check whether the ZIP extension is available in the active PHP configuration.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">4. Check the PHP Error Logs<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">If the issue continues, inspect the PHP-FPM or web server error logs.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">For PHP-FPM:<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">sudo journalctl -u php8.3-fpm -n 50 --no-pager<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">For Apache:<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">sudo tail -n 50 \/var\/log\/apache2\/error.log<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">For Nginx:<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">sudo tail -n 50 \/var\/log\/nginx\/error.log<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Check the logs for missing extension errors, PHP configuration problems, or service startup failures.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">PHP ZipArchive Installation Flowchart<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">The following flowchart explains the process of identifying and fixing the <code>ZipArchive<\/code> class not found error.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><a href=\"https:\/\/pheonixsolutions.com\/blog\/wp-content\/uploads\/2019\/09\/PHP-ZipArchive-Troubleshooting-Flowchart.png\"><img fetchpriority=\"high\" decoding=\"async\" width=\"977\" height=\"1024\" src=\"https:\/\/pheonixsolutions.com\/blog\/wp-content\/uploads\/2019\/09\/PHP-ZipArchive-Troubleshooting-Flowchart-977x1024.png\" alt=\"Flowchart showing how to install and enable the PHP ZIP extension and fix the ZipArchive class not found error.\n\" class=\"wp-image-12702\" srcset=\"https:\/\/pheonixsolutions.com\/blog\/wp-content\/uploads\/2019\/09\/PHP-ZipArchive-Troubleshooting-Flowchart-977x1024.png 977w, https:\/\/pheonixsolutions.com\/blog\/wp-content\/uploads\/2019\/09\/PHP-ZipArchive-Troubleshooting-Flowchart-286x300.png 286w, https:\/\/pheonixsolutions.com\/blog\/wp-content\/uploads\/2019\/09\/PHP-ZipArchive-Troubleshooting-Flowchart-768x805.png 768w, https:\/\/pheonixsolutions.com\/blog\/wp-content\/uploads\/2019\/09\/PHP-ZipArchive-Troubleshooting-Flowchart.png 1225w\" sizes=\"(max-width: 977px) 100vw, 977px\" \/><\/a><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\">Conclusion<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">The <strong>PHP Fatal error: Class &#8216;ZipArchive&#8217; not found<\/strong> error generally occurs when the PHP ZIP extension is missing, disabled, or not loaded by the PHP environment used by the application.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Installing the appropriate ZIP package, enabling the extension, and restarting the relevant Apache or PHP-FPM service will resolve the issue in most cases.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">If you are running multiple PHP versions, always make sure the extension is installed for the correct PHP version. Finally, verify the installation using <code>php -m<\/code>, <code>php --ri zip<\/code>, and <code>class_exists('ZipArchive')<\/code>.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Regularly checking PHP extensions and server configurations helps prevent compatibility issues and keeps PHP applications running smoothly.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">For assistance with PHP extension installation, server configuration, or PHP application troubleshooting, contact the technical team at <strong>Pheonix Solutions<\/strong>.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Frequently Asked Questions (FAQs)<\/h2>\n\n\n\n<h3 class=\"wp-block-heading\">1. What causes the PHP Fatal error: Class &#8216;ZipArchive&#8217; not found?<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">This error usually occurs when the PHP ZIP extension is not installed, disabled, or unavailable in the PHP configuration used by your application. Installing and enabling the correct extension generally resolves the issue.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">2. How do I check whether the PHP ZIP extension is installed?<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Run the following command:<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">php -m | grep -i zip<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">If <code>zip<\/code> appears in the output, the extension is loaded in the CLI environment. You can also verify the <code>ZipArchive<\/code> class using:<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">php -r \"var_dump(class_exists('ZipArchive'));\"<\/pre>\n\n\n\n<h3 class=\"wp-block-heading\">3. Do I need to restart Apache or PHP-FPM after installing the PHP ZIP extension?<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Yes. Restart the relevant PHP service to load the newly installed extension. If you use Apache with mod_php, restart Apache. If your application uses PHP-FPM, restart the corresponding PHP-FPM service. Nginx generally does not require a restart for PHP extension installation.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Related Articles<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\"><a href=\"https:\/\/pheonixsolutions.com\/blog\/fixedyour-php-installation-appears-to-be-missing-the-mysql-extension-which-is-required-by-wordpress\/\">Fixed:Your PHP installation appears to be missing the MySQL extension which is required by WordPress.<\/a><\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><a href=\"https:\/\/pheonixsolutions.com\/blog\/create-contact-form-with-php\/\">Create contact form with php<\/a><\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Need Help Installing and Configuring PHP ZIP Extension?<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Need assistance with PHP ZIP extension installation, ZipArchive configuration, PHP version compatibility, or troubleshooting PHP errors? Our experts can help with PHP extension installation, Linux server administration, Apache and Nginx configuration, PHP-FPM management, and server maintenance.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Get in touch with our team <a href=\"https:\/\/pheonixsolutions.com\/contact\">here<\/a>.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Post Date: September 19, 2019Last Updated: October 31, 2026 Introduction When working with PHP applications, you may encounter the error [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":12703,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"site-sidebar-layout":"default","site-content-layout":"","ast-site-content-layout":"default","site-content-style":"default","site-sidebar-style":"default","ast-global-header-display":"","ast-banner-title-visibility":"","ast-main-header-display":"","ast-hfb-above-header-display":"","ast-hfb-below-header-display":"","ast-hfb-mobile-header-display":"","site-post-title":"","ast-breadcrumbs-content":"","ast-featured-img":"","footer-sml-layout":"","ast-disable-related-posts":"","theme-transparent-header-meta":"","adv-header-id-meta":"","stick-header-meta":"","header-above-stick-meta":"","header-main-stick-meta":"","header-below-stick-meta":"","astra-migrate-meta-layouts":"default","ast-page-background-enabled":"default","ast-page-background-meta":{"desktop":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"tablet":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"mobile":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""}},"ast-content-background-meta":{"desktop":{"background-color":"var(--ast-global-color-4)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"tablet":{"background-color":"var(--ast-global-color-4)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"mobile":{"background-color":"var(--ast-global-color-4)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""}},"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_hide_featured_image":false,"_jetpack_featured_image_duplicate_dismissed":0,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":false,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2},"jetpack_post_was_ever_published":false},"categories":[1020],"tags":[712],"class_list":["post-5047","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-containers-kubernetes","tag-class-ziparchive-not-found","psol-cat-containers-kubernetes"],"jetpack_publicize_connections":[],"jetpack_shortlink":"https:\/\/wp.me\/phn2x7-1jp","jetpack_sharing_enabled":true,"jetpack_featured_media_url":"https:\/\/pheonixsolutions.com\/blog\/wp-content\/uploads\/2019\/09\/PHP-ZipArchive-Error-Fix-Guide.png","_links":{"self":[{"href":"https:\/\/pheonixsolutions.com\/blog\/wp-json\/wp\/v2\/posts\/5047","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/pheonixsolutions.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/pheonixsolutions.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/pheonixsolutions.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/pheonixsolutions.com\/blog\/wp-json\/wp\/v2\/comments?post=5047"}],"version-history":[{"count":1,"href":"https:\/\/pheonixsolutions.com\/blog\/wp-json\/wp\/v2\/posts\/5047\/revisions"}],"predecessor-version":[{"id":12704,"href":"https:\/\/pheonixsolutions.com\/blog\/wp-json\/wp\/v2\/posts\/5047\/revisions\/12704"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/pheonixsolutions.com\/blog\/wp-json\/wp\/v2\/media\/12703"}],"wp:attachment":[{"href":"https:\/\/pheonixsolutions.com\/blog\/wp-json\/wp\/v2\/media?parent=5047"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/pheonixsolutions.com\/blog\/wp-json\/wp\/v2\/categories?post=5047"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/pheonixsolutions.com\/blog\/wp-json\/wp\/v2\/tags?post=5047"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}