Zipper icon indicating copy to clipboard operation
Zipper copied to clipboard

Call to a member function close() on string

Open eaponiente opened this issue 7 years ago • 3 comments

PHP 7.2 Laravel 5.2

I already installed ZipArchive package,

this error always occur when ever I upload the zip file Call to a member function close() on string its working before, but suddenly its giving error

$file = $request->file('package');
$zipper = new Zipper();
$zipper->make($file)
            ->extractTo("uploads/some_folder", array('sidebars'), Zipper::BLACKLIST);

eaponiente avatar Jan 16 '18 07:01 eaponiente

Maybe your PHP version is not compiled with zip support.

ghost avatar Jan 22 '18 19:01 ghost

@eaponiente Could you solve it somehow?

nextlevelshit avatar May 05 '18 13:05 nextlevelshit

This PR should throw the right exception now. After that follow these steps if your using an ubuntu distro for instance. First check for any package that corresponds to your PHP Version.

sudo apt-cache search php7*-zip

If there are some matching packages, just install them:

sudo apt-get install php-7[REPLACE THAT INCLUDING THE BRACKETS]-zip

Last but not least restart your apache if you're using one:

sudo service apache2 restart

If you were using a locale dev server then restart it:

php -S localhost:8000 -t public

nextlevelshit avatar May 05 '18 14:05 nextlevelshit