Skip to content
Grav 2.0 is officially stable. Read the announcement →
Installation & Hosting

PHP Zip extension is not installed - local install

Started by kaktux 9 years ago · 16 replies · 97503 views
9 years ago

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 ;) )
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.

9 years ago

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
last edited 08/28/17 by arank
9 years ago

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

9 years ago

@chris_jung: ???

That's exactly what i said.

9 years ago

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:

BASH
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 ;)

9 years ago

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

9 years ago

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

last edited 08/29/17 by arank
9 years ago

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

TXT
[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.
9 years ago

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?

last edited 08/30/17 by arank
9 years ago

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 ;)

/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.

1 reply
9 years ago

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

9 years ago kaktux Yes - the zip.so is there Also both php-common files are installed. Well - at least its qu…

@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!

last edited 08/30/17 by arank
8 years ago

Should be fine by using this:

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

Restart (depend on your system):

TXT
# sudo systemctl restart nginx
# sudo systemctl restart php-fpm
last edited 10/20/18 by shafiq farhan

Suggested topics

Topic Participants Replies Views Activity
Installation & Hosting · by antoinep, 1 month ago
8 603 1 month ago
Installation & Hosting · by Jürgen Dietrich, 8 months ago
0 368 8 months ago
Installation & Hosting · by rappluk, 9 months ago
0 421 9 months ago
Installation & Hosting · by N, 1 year ago
3 350 1 year ago
Installation & Hosting · by Youle, 1 year ago
1 279 1 year ago