Home >Backend Development >PHP Tutorial >Why Can\'t I Find the \'ZipArchive\' Class in PHP?
Issue:
When attempting to establish a zip archive using the 'Archive_Zip 0.1.1' library on a Linux server, users encounter the following error:
Fatal error: Class 'ZipArchive' not found in ...
Cause:
The 'ZipArchive' class is not recognized by the system because the PHP zip extension is missing.
Solution:
To resolve this issue and enable the 'ZipArchive' class, the zip extension must be installed for PHP. Debian and Ubuntu users can typically install it with the following command:
sudo apt update sudo apt install php-zip
Restart Webserver:
After the installation process is complete, restart the webserver to activate the changes. For example, on Apache servers:
sudo systemctl restart apache2
Additional Notes:
The above is the detailed content of Why Can\'t I Find the \'ZipArchive\' Class in PHP?. For more information, please follow other related articles on the PHP Chinese website!