Jump to content

ZipArchive help


squiggerz

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

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.