I want to have a php file that is able to unzip a .zip file and just put it in the same folder.
I have this php code:
$zip = new ZipArchive;
$zip->open('/path/to//file.zip');
$zip->extractTo('/path/to/extract/');
$zip->close();
however, this does not work at all, and as soon as the code gets to the first line it dies and stops. What is going on?
It is because there is a missing PHP extension caused by the PHP upgrade. In this case, ZIP extension was required to do so, which is one of the extension missing.
From announcement:
3 Likes
Admin
July 23, 2020, 3:21pm
#3
What is the PHP error you see when you try to run that code? If you don’t see any error, please try enabling display_errors
on the domain:
When trying to access your website, you may see a page which returns the status code “500”. In Google Chrome, you’ll see a page with the error code HTTP ERROR 500. There are typically two reasons which can cause this error: The PHP code has...
3 Likes
system
Closed
August 7, 2020, 3:21pm
#4
This topic was automatically closed 15 days after the last reply. New replies are no longer allowed.