Skip to content
This repository has been archived by the owner on Feb 25, 2020. It is now read-only.

Call to a member function close() on string #117

Open
eaponiente opened this issue Jan 16, 2018 · 3 comments
Open

Call to a member function close() on string #117

eaponiente opened this issue Jan 16, 2018 · 3 comments

Comments

@eaponiente
Copy link

eaponiente commented Jan 16, 2018

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);
@ghost
Copy link

ghost commented Jan 22, 2018

Maybe your PHP version is not compiled with zip support.

@nextlevelshit
Copy link
Contributor

@eaponiente Could you solve it somehow?

nextlevelshit added a commit to nextlevelshit/Zipper that referenced this issue May 5, 2018
$this should not be assigned with any information as long it is not clear that the corresponding repositories can be loaded. Otherwise there won't be throwing the right exception. Now for instance the corrector exception will be

> Error: Your PHP version is not compiled with zip support

Instead of

> Call to a member function close() on string
@nextlevelshit
Copy link
Contributor

nextlevelshit commented May 5, 2018

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

Chumper pushed a commit that referenced this issue Mar 24, 2019
$this should not be assigned with any information as long it is not clear that the corresponding repositories can be loaded. Otherwise there won't be throwing the right exception. Now for instance the corrector exception will be

> Error: Your PHP version is not compiled with zip support

Instead of

> Call to a member function close() on string
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants