Do you support Zip files with PHP?
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.
Was this page helpful?
Thanks for your feedback.