PHP Zip extension is not installed - local install

Hi there,

just wanted to tryout grav on my own pc (maui linux) - but cant get it to work.
I just

  1. downloaded grav
  2. extracted + moved the folder to /var/www/html/grav
  3. changed owner rights - sudo chown -R www-data:www-data /var/www/html/
  4. installed apache2 php php-zip php-curl php-gd php-curl php-xml and some others
  5. opened localhost in a browser and opened the /grav folder

Then the installation dialogue with the green check marks appears - an one red x telling:
PHP Zip extension is not installed

Well - it is. And all solutions i could find having the same problems are solved by installing the package php-zip or php7.0-zip or ask my hoster (which doesnt work with a local install :wink: )
I tried both, un- and reinstalled both - restarted but still no success.

The only thread in this forum with this problem i could found is archived and no solution is described.

Would be great if you could help me out or have tips/clues how to get it running

btw - discourse forbids to have similar titles - the mentioned thread in the archive has also “PHP Zip extension is not installed” - doesnt make much sense to me to forbid similar titles - but thats another topic and just my 2 cents.

Maybe in your php.ini the php.zip extension needs to be enabled:
https://learn.getgrav.org/basics/requirements#php-requirements

point 2-4:

  • On a local machine you don’t have to move to var/www…you can simply name the folder homepage, etc.
  • I don’t need to change owner rights for my grav folder on my linux mint pc.
  • I don’t have to install apache2

Installing php-zip and enabling! should help locally as well :smiley:

@chris_jung: ???

That’s exactly what i said.

well - thats exactly my problem - php-zip package is installed BUT - i didnt find a way to activate

also about the points 2-4: didnt work for me in another directory, didnt work without changing the user right, did have to install apache to get it running at all.

Trying to enable php-zip i did:

php --ini

Configuration File (php.ini) Path: /etc/php/7.0/cli
Loaded Configuration File:         /etc/php/7.0/cli/php.ini
Scan for additional .ini files in: /etc/php/7.0/cli/conf.d
Additional .ini files parsed:      /etc/php/7.0/cli/conf.d/10-opcache.ini,
/etc/php/7.0/cli/conf.d/10-pdo.ini,
/etc/php/7.0/cli/conf.d/15-xml.ini,
/etc/php/7.0/cli/conf.d/20-apcu.ini,
/etc/php/7.0/cli/conf.d/20-calendar.ini,
/etc/php/7.0/cli/conf.d/20-ctype.ini,
/etc/php/7.0/cli/conf.d/20-curl.ini,
/etc/php/7.0/cli/conf.d/20-dom.ini,
/etc/php/7.0/cli/conf.d/20-exif.ini,
/etc/php/7.0/cli/conf.d/20-fileinfo.ini,
/etc/php/7.0/cli/conf.d/20-ftp.ini,
/etc/php/7.0/cli/conf.d/20-gd.ini,
/etc/php/7.0/cli/conf.d/20-gettext.ini,
/etc/php/7.0/cli/conf.d/20-iconv.ini,
/etc/php/7.0/cli/conf.d/20-json.ini,
/etc/php/7.0/cli/conf.d/20-mbstring.ini,
/etc/php/7.0/cli/conf.d/20-phar.ini,
/etc/php/7.0/cli/conf.d/20-posix.ini,
/etc/php/7.0/cli/conf.d/20-readline.ini,
/etc/php/7.0/cli/conf.d/20-shmop.ini,
/etc/php/7.0/cli/conf.d/20-simplexml.ini,
/etc/php/7.0/cli/conf.d/20-sockets.ini,
/etc/php/7.0/cli/conf.d/20-sysvmsg.ini,
/etc/php/7.0/cli/conf.d/20-sysvsem.ini,
/etc/php/7.0/cli/conf.d/20-sysvshm.ini,
/etc/php/7.0/cli/conf.d/20-tokenizer.ini,
/etc/php/7.0/cli/conf.d/20-wddx.ini,
/etc/php/7.0/cli/conf.d/20-xmlreader.ini,
/etc/php/7.0/cli/conf.d/20-xmlwriter.ini,
/etc/php/7.0/cli/conf.d/20-xsl.ini

So my php.ini seems to be at /etc/php/7.0/cli/php.ini
I found a thread in another forum where they added “extension=zip.so” to that file. But that didnt to the trick.

I am in no way a coder etc - just a regular user - so i just search and try :wink:

You have to install both:
php-zip and php7.0-zip

Look here:
/etc/php/7.0/mods-available
Should be a file: zip.ini
with content:
; configuration for php zip module
; priority=20
extension=zip.so

well - i installed, removed and reinstalled both packeges already 3 times :wink:
Also the zip.ini is available - with exactly the quoted content.

Still i get the error message:

PHP Zip extension is not installed

Ok, my last idea why it couldn’t work is that you moved your folder to /var…
On a local install It should work (and it works!) in any folder of your /home directory.

Download grav package.
Unzip it to a folder of your home directory
Open Terminal in this folder:
Type: php -S localhost:8000 system/router.php

Terminal Output something like this:
PHP 7.0.22-0ubuntu0.16.04.1 Development Server started at Tue Aug 29 19:02:30 2017
Listening on http://localhost:8000
Document root is /home/axel/Downloads/Homepage
Press Ctrl-C to quit

Open your browser, Adressbar: localhost:8000

is the zip.ini available in /etc/php7.0/mods-enabled/ ?

come on chris, we had that already.
read the last post of kaktux!

just tried the /home install - it gives an error.
After unpacking into /home/Programs and typing:
php -S localhost:8000 system/router.php :

[Wed Aug 30 13:12:08 2017] PHP Warning:  PHP Startup: Unable to load dynamic library '/usr/lib/php/20151012/zip.so' - libzip.so.4: cannot open shared object file: No such file or directory in Unknown on line 0
PHP 7.0.22-0ubuntu0.16.04.1 Development Server started at Wed Aug 30 13:12:08 2017
Listening on http://localhost:8000
Document root is /home/computername/Programs
Press Ctrl-C to quit.

Did you check /usr/lib/php/20151012/
Is the zip.so in there?

Just noticed:
There should be a file:
/etc/php/7.0/cli/conf.d/20-zip.ini that links to the zip.ini in /etc/php/7.0/mods-available

Seems to be missing in your second post?

Yes - the zip.so is there

Also both php-common files are installed.

Well - at least its quite confusing that it doesnt simply work by installing a lot of php-packages :wink:

/etc/php/7.0/cli/conf.d/20-zip.ini is there . Dont know why it wasnt shown when it used php --ini the first time - when i repeat now it is shown!

I also got a netbook available with another linux version . i will try there - and report back if it works.

mod-available, yes. mod-enabled was not the discussion. But available mods are not enabled by default. They need to have a symlink on mods-enabled as well.

The symlink should be available in /etc/php/7.0/apache2/conf.d

@kaktux

There is a known bug in KDE Neon Editions (like maui linux):

https://bugs.launchpad.net/ubuntu/+source/php7.0/+bug/1697832
https://bugs.kde.org/show_bug.cgi?id=381183

check in terminal: php -v
the error should show up.

so as long your netbook doesn’t use kde neon it should work.
you could also install another desktop (mate, cinnamon,xfce) in maui.
good luck!

Should be fine by using this:

# yum --enablerepo=epel install php-pecl-zip

Restart (depend on your system):

# sudo systemctl restart nginx
# sudo systemctl restart php-fpm

A post was split to a new topic: How to bypass Zip requirement