Do you support Zip files with PHP?
Ce contenu n’est pas encore disponible dans votre langue.
Yes. PHP on Ruachost hosting supports Zip archives.
The zip extension gives you the ZipArchive class. Your scripts can use it to:
- Create
.zipfiles, for example to let visitors download several files at once. - Read the contents of a Zip file.
- Extract uploaded Zip files.
Many applications rely on it. WordPress, for example, uses it to install plugins and themes from .zip files.
<?php$zip = new ZipArchive();if ($zip->open('archive.zip', ZipArchive::CREATE) === true) { $zip->addFile('report.pdf'); $zip->close();}If you get a “Class ZipArchive not found” error
Section titled “If you get a “Class ZipArchive not found” error”- Log in to cPanel.
- Open Select PHP Version.
- Click Extensions and make sure zip is ticked.
Cette page vous a-t-elle aidé ?
Merci pour votre retour.