backdrop / backdrop-issues

Issue tracker for Backdrop core.
144 stars 40 forks source link

Add check for PHP zip extension to Status Report #3978

Open jenlampton opened 5 years ago

jenlampton commented 5 years ago

We've had multiple reports of problems with the PHP zip extension - or, more specifically, sites that DO have the PHP zip extension installed, reporting that they DO NOT.

See this forum topic: https://forum.backdropcms.org/forum-topic/php-zip-extension-issue-192?page=0%2C0#comment-1219

TODO:

klonos commented 5 years ago

Use a better check for the PHP zip extension

Care to elaborate on this one?

jenlampton commented 5 years ago

I won't know the technical detalis until I look at the code, but if the check we are using now says that zip is not installed when it actually is installed, then we need to use a different check: one that works ;)

edit: I have updated the original ticket to make this problem more clear.

tuxrouge commented 5 years ago

to solve it I just had to clear the cache (find here https://github.com/backdrop/backdrop-issues/issues/2717)

stpaultim commented 2 years ago

It has been reported in the forum, that this is still an issue: https://forum.backdropcms.org/comment/3430#comment-3430

indigoxela commented 2 years ago

It has been reported by one person. What we'd need to fix, are steps to reproduce. Personally, I never ran into this problem, so I wouldn't know where to start.

The installer checks like that: array_key_exists('zip', archiver_get_info());

stpaultim commented 2 years ago

It has been reported by one person.

In the forum topic, at least two people report the problem and they do share additional information about their specific situations. I'm not sure if what they provide is sufficient to help debug this and maybe we'll need to wait for additional information.

indigoxela commented 2 years ago

It's still puzzling. No steps to reproduce, only a handful of assumptions.

The system module defines the zip archiver in its hook_archiver_info(). So, as soon as the system module is installed, that archiver is available. The updater module does need the zip archiver, but it's installed after the system module.

Yes, archiver_get_info does use static caching, but I wouldn't know of a situation, in which this cache could miss the zip extension.

There might be some sort of race condition, but with core alone it's not reproducible - at least I wouldn't know how. So maybe we'd need to figure out which contrib module might be interfering here. If that's the reason.

findlabnet commented 2 years ago

webform.install (l.698): if (!class_exists('ZipArchive'))...

indigoxela commented 2 years ago

Interesting, webform. But...

if (!class_exists('ZipArchive'))... 

The class does exist, independently from Backdrop (ships with php). The extension is installed and active - confirmed by the posters in forum. And the warning message shown is from core.

@findlabnet do you know of any way to reproduce the warning on install?

findlabnet commented 2 years ago

hook_requirements in the module install script? At least I did it for php_curl.

indigoxela commented 2 years ago

hook_requirements in the module install script? At least I did it for php_curl.

How does that help to reproduce the problem reported in the forum? Have you been able to?

findlabnet commented 2 years ago

Sorry, it looks like my misunderstanding of beginning of this topic. Moreover, I have not used either the Hyper-V VM or the Project installer, so I have nothing to add.

alanmels commented 1 week ago

I've hit the same problem today, found https://forum.backdropcms.org/forum-topic/php-zip-extension-issue-192 and then this issue. My conclusion is the problem is not related to specifically PHP zip extension, but site cache. Site cache needs to be cleared at certain point for it to see newly installed PHP extensions.

Restarting Apache as suggested on forum had no effect. Only clearing the cache helped.