"If a worker wants to do his job well, he must first sharpen his tools." - Confucius, "The Analects of Confucius. Lu Linggong"
Front page > Programming > Why Am I Getting a \"Class \'ZipArchive\' Not Found\" Error After Installing Archive_Zip on My Linux Server?

Why Am I Getting a \"Class \'ZipArchive\' Not Found\" Error After Installing Archive_Zip on My Linux Server?

Posted on 2025-03-24
Browse:325

Why Am I Getting a \

Class 'ZipArchive' Not Found Error While Installing Archive_Zip on Linux Server

Symptom:

When attempting to run a script that utilizes the ZipArchive class after installing Archive_Zip 0.1.1 on a Linux server, users may encounter the following fatal error:

Fatal error: Class ZipArchive not found in ...

Cause:

This error occurs because the ZipArchive class requires the PHP zip extension to be present.

Resolution:

To resolve this issue, follow these steps:

1. Install the PHP Zip Extension:

  • Debian/Ubuntu:

    sudo apt update
    sudo apt install php-zip
  • Other Linux Distributions:
    Refer to the official PHP documentation for instructions on installing the zip extension.

2. Restart the Web Server:

  • Apache:

    sudo systemctl restart apache2
  • Nginx:

    sudo systemctl restart nginx

Additional Notes:

  • Ensure that the script has proper file permissions.
  • If the error persists, verify that the zip extension is enabled in php.ini.
Latest tutorial More>

Disclaimer: All resources provided are partly from the Internet. If there is any infringement of your copyright or other rights and interests, please explain the detailed reasons and provide proof of copyright or rights and interests and then send it to the email: [email protected] We will handle it for you as soon as possible.

Copyright© 2022 湘ICP备2022001581号-3