Occ complains about zip module not found after upgrading to php 7.0

In order to upgrade my nextcloud to v11 I first upgraded to v.10.0.2. At that point I upgraded my php from 5.4 to 7.0 using the “remi” repo (this is a RHEL 7.2 system). Now I have php 7.0.14.

Trying to run: sudo -u apache php occ maintenance:mode --on gives me:
PHP module zip not installed.
Please ask your server administrator to install the module.

An unhandled exception has been thrown:
Exception: Environment not properly prepared. in /var/www/net-tar/lib/private/Console/Application.php:121
Stack trace:
#0 /var/www/net-tar/console.php(97): OC\Console\Application->loadCommands(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#1 /var/www/net-tar/occ(11): require_once(’/var/www/net-ta…’)

However, I believe the zip module is installed. The php.ini is located at /etc/opt/remi/php70/php.ini
I symlinked this file to /etc/php.ini. In a web page displaying phpinfo ZIp is listed as a module.

My nextcloud site is also unavailable for the same reason:
“PHP module zip not installed.
Please ask your server administrator to install the module.”

What should I do?


Hi, you have ton install the PHP7 ZIP module,

For ubuntu/debian it’s
apt install php7.0-zip

For RHEL i hope it’s the same name.

Thanks, but the module is called php70-php-pecl-zip, and it is installed. The file zip.so is present: /opt/remi/php70/root/usr/lib64/php/modules/zip.so, and the module is activated by /etc/opt/remi/php70/php.d/40-zip.ini. In order to use the library I have LD_LIBRARY_PATH=/opt/remi/php70/root/usr/lib64 in my environment.

Does that install the plain zip library?

yum install zip and also doh apols but restart apache.
As all I can say that is weird as all looks ok.

All I think of is to is sudo apt-cache search php7.0-* and just make sure what the admin manual suggests is installed from the 7 libs.
Also another dumb question but if you do a php-info the php7-mod is actually enabled and not the old 5.4?

Also did you have a tutorial for installing nextcloud on RHEL with php7.0 ?

Thanks for all the responses. I ended up symlinking /opt/remi/php70/root/usr/lib64/php/modules/zip.so to /usr/lib64/php/modules/zip.so. This way the zip module got recognized both in the CLI and in web pages.
However, I ran into another problem: something needed the mysql php extension in my nextcloud setup. This is not available in php 7.0 any more (only mysqli). So for the time being I downgraded back to php 5.4 and stayed with nextcloud 10.0.2.

We could do with a distro list as at the moment Ubuntu 16.04 seems to be the default distro that suits 11 best.

I think I must of made some noob errors as it was my first port of call and swapped to Debian 8.6 which also needs Aufs enabling in the kernel or Collabora (CODE) will not function correctly.

The dependency hell that can happen with RHEL & Ubuntu is about equal with RHEL hitting a slower cautious outdated lib problem, with Ubuntu just being the flip side of sometimes racing too far ahead.

I did try CentOS and actually found PHP 7.0 with the remi howto’s I found seemed to work perfect for me, but still hit a blank with Collabora.
But then again with Ubuntu 16.04 from the logs APCu doesn’t seem to be recognized via CLI and it would seem to be swings and roundabouts with both.

To be honest I have debian 8.6 running with no memcache apart from the default Zend opcache running and from usage have still to feel a user improvement from another.

We could probably do with an ‘official’ distro and lib revision listing of known good to maybe start with so then with newer versions it is easier to differentiate between Nextcloud problems and Distro/Lib problems.

Maybe we should have sections that is for the latest install on specific distro’s ?

I did get further with CentOS than you and apart from Collabora really didn’t have that much of a problem.
But then again may of missed the OCC cron job complains.