0

I have tried this in two different environments, one works one does not. All I am trying to do is open the zip but at the moment I call one of those functions zip_open or new ZipArchive() the code brakes, exits without an error. What could be the problem ?

$zip = file_get_contents($url, false, $context);
file_put_contents($zipfile, $zip);
chmod($zipfile, 0775);

$zip = new ZipArchive(); 
$zip->open($zipfile); 
Lu Blue
  • 335
  • 3
  • 10
  • Can you provide the code and describe where exactly is the problem? What have you tried and a proper error message? – Danizavtz May 19 '20 at 09:16
  • @Danizavtz I add the code block , there is no error, no warrning it just stops working like it exits after $zip = new ZipArchive(); – Lu Blue May 19 '20 at 09:39
  • What php version are you using? What happens when you run the zip command in cmd line shell? – Danizavtz May 19 '20 at 10:23
  • @Danizavtz php -v : PHP 7.1.30-1+ubuntu18.04.1+deb.sury.org+1 (cli) (built: May 31 2019 – Lu Blue May 19 '20 at 10:38
  • @Danizavtz zip : Copyright (c) 1990-2008 Info-ZIP - Type 'zip "-L"' for software license. Zip 3.0 (July 5th 2008). Usage: zip [-options] [-b path] [-t mmddyyyy] [-n suffixes] [zipfile list] [-xi list] – Lu Blue May 19 '20 at 10:38

0 Answers0