Hello,
When I installed Piwigo and then tried to install some plugins, I kept getting the message:
Abort pclzip.lib.php : Missing zlib extensions
Running `php -m` showed that the Zlib extension was, in fact, installed.
This is similar to the problem mentioned in this topic (though the solution proposed in that topic does not work for the reason claimed - it actually works because PHP is compiled against a different version of Zlib.)
The root of the problem lies in the fact that PHP compiled with "large file support" (as PHP on new Ubuntu installs is compiled) names the function `gzopen` as `gzopen64` instead. Piwigo looks for the original function name, and then complains when it cannot be found.
The simplest solution for this problem is to check whether the function exists, and to alias it if it does not. For example, like this:
if (!extension_loaded('zlib')) { die('Abort '.basename(__FILE__).' : Missing zlib extensions'); } if (!function_exists('gzopen') && function_exists('gzopen64')) { function gzopen(string $filename , string $mode, int $use_include_path = 0) { return gzopen64($filename, $mode, $use_include_path) } }
Another way to do it would be to use a function pointer, like this:
if (!extension_loaded('zlib')) { die('Abort '.basename(__FILE__).' : Missing zlib extensions'); } if (function_exists('gzopen')) { $this->gzopen_func = 'gzopen'; } elseif (function_exists('gzopen64')) { $this->gzopen_func = 'gzopen64'; } else { die('Abort '.basename(__FILE__).' : Could not find gzopen'); }
Then, instead of saying `gzopen(...)`, you would use this:
$gzopen = $this->gzopen_func; $gzopen(...)
(Note that this could probably be done in a single line - I just did it in two lines for clarity about what points where.)
Note that I had this issue on Ubuntu, but I found similar reports about gzopen64 on many platforms.
Piwigo version: 2.6.2
PHP version: 5.5.9-1ubuntu4
MySQL version: 5.5.37-MariaDB-1~trusty-log
Piwigo URL: https://ph05.10815.net/photos
Last edited by kohenkatz (2014-05-09 06:56:10)
Offline
Hello
thx for reporting
please open a ticket http://piwigo.org/bugs/
Offline
Wow, kohenkatz!!! thank YOU!!!
I basically had the SAME problem with Piwik update and couldn't figure it out. Installed the module but no luck.
The moment I read "The root of the problem lies in the fact that PHP compiled with "large file support" (as PHP on new Ubuntu installs is compiled) names the function `gzopen` as `gzopen64` instead." -- I was like...AHA!
nothing a little grep action couldn't figure out the locations of the gzopen module call and we're in business!!
This helped me as well. Thanks!
Offline
Hi,
I'm sorry to ask this, but I'm a bit lost as to which file and where to edit to correct this issue. Could someone explain a bit more?
Editing files no big deal but when it comes to compiling (at least the term) I get lost easily.
this has been targeted for 2.7 beta 3
Offline
flop25 wrote:
this has been targeted for 2.7 beta 3
I'm (honestly) wondering how you will manage to upgrade the upgrade plugin when the upgrade plugin is broken?
(i mean, except manual upgrade)
Offline
That's not the plugin, that's the core. So the only solution is manual update. This basically means overwriting files and launching the upgrade page
Offline
Have a look at that related issue:
[Github] dokuwiki issue #865
Offline
Issue fixed for the upcoming Piwigo 2.7.1, see [Subversion] r29904
Offline
plg wrote:
Issue fixed for the upcoming Piwigo 2.7.1, see [Subversion] r29904
Merci :)
Offline
Still fails!
Update to Piwigo 2.7.2
Piwigo version
Piwigo 2.6.3
Check for upgrade
Environment
Operating system: Linux
PHP: 5.5.9-1ubuntu4.5 (Show info) [2014-12-26 22:12:01]
MySQL: 5.5.40-0ubuntu0.14.04.1 [2014-12-26 22:12:01]
Graphics Library: ImageMagick 6.7.7-10