Jump to content

Recommended Posts

Ok, according to my phpinfo, I have a php install with the --enable-zip configuration. Yet when I try to run this:  if (zip_open($filename) === TRUE) 

 

... or any other function under the ZipArchive class (even if I start a new ZipArchive).. I get this error:

 

PHP Fatal error:  Call to undefined function zip_open() ... so... am I needing to include a file in a lib somewhere in my php file or something? I figured if ZipArchive was configured by php, it should include all the global functions associated right??

 

Here's the excerpt from php info that shows the --enable-zip if that is any help

 

 

'./configure' '--host=i686-pc-linux-gnu' '--build=i686-pc-linux-gnu' '--target=i386-redhat-linux-gnu' '--program-prefix=' '--prefix=/usr' '--exec-prefix=/usr' '--bindir=/usr/bin' '--sbindir=/usr/sbin' '--sysconfdir=/etc' '--datadir=/usr/share' '--includedir=/usr/include' '--libdir=/usr/lib' '--libexecdir=/usr/libexec' '--localstatedir=/var' '--sharedstatedir=/usr/com' '--mandir=/usr/share/man' '--infodir=/usr/share/info' '--cache-file=../config.cache' '--with-config-file-path=/etc' '--with-config-file-scan-dir=/etc/php.d' '--enable-force-cgi-redirect' '--disable-debug' '--enable-pic' '--disable-rpath' '--enable-inline-optimization' '--with-bz2' '--with-db4=/usr' '--with-curl' '--with-exec-dir=/usr/bin' '--with-freetype-dir=/usr' '--with-png-dir=/usr' '--enable-gd-native-ttf' '--without-gdbm' '--with-gettext' '--with-ncurses' '--with-iconv' '--with-jpeg-dir=/usr' '--with-openssl' '--with-png' '--with-regex=system' '--with-expat-dir=/usr' '--with-dom=shared,/usr' '--with-dom-xslt=/usr' '--with-dom-exslt=/usr' '--with-zlib' '--with-layout=GNU' '--enable-bcmath' '--enable-exif' '--enable-ftp' '--enable-magic-quotes' '--enable-safe-mode' '--enable-sockets' '--enable-sysvsem' '--enable-sysvshm' '--enable-discard-path' '--enable-track-vars' '--enable-trans-sid' '--enable-yp' '--with-kerberos' '--with-ldap=shared' '--with-mysql' '--enable-memory-limit' '--enable-bcmath' '--enable-shmop' '--enable-calendar' '--enable-dbx' '--enable-dio' '--enable-mcal' '--enable-mbstring=shared' '--enable-mbstr-enc-trans' '--enable-mbregex' '--enable-force-cgi-redirect' '--enable-zip' '--with-apxs2=/usr/sbin/apxs'

Link to comment
https://forums.phpfreaks.com/topic/61014-ziparchive-help/
Share on other sites

you need ZZIPlib for those functions

 

<?php
//check if zziplib is installed
if(function_exists('zip_open()')){
if (zip_open($filename) === TRUE) {

}
}else{
echo "ZZIPlib NOT installed";
}

 

Note that ZZIPlib only provides a subset of functions provided in a full implementation of the ZIP compression algorithm and can only read ZIP file archives. A normal ZIP utility is needed to create the ZIP file archives read by this library.

 

download zziplib from http://zziplib.sourceforge.net/ if needed

Link to comment
https://forums.phpfreaks.com/topic/61014-ziparchive-help/#findComment-303610
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.