I made a zip stream handler in case your distribution does not have the built in one using the new ZipArchive system. This one also features the ability to grab entries by index as well as by name. It is similar in capabilities to the builtin gzip/bzip2 compression stream handlers (http://us2.php.net/manual/en/wrappers.compression.php) except it does not support writing.To use:fopen('zip://absolute/path/to/file.zip?entryname', $mode) orfopen('zip://absolute/path/to/file.zip#entryindex', $mode) orfopen('zip://absolute/path/to/file.zip', $mode)$mode can only be 'r' or 'rb'. In the last case the first entry in the zip file is used.<?phpclass ZipStream { public $zip; public $entry; public $length; public $position; public function stream_open($path, $mode, $options, &$opened_path) { if ($mode != 'r' && $mode != 'rb') return false; $path = 'file:///'.substr($path, 6); $url = parse_url($path); $filename = $url['path']; $this->zip = zip_open($filename); if (!is_resource($this->zip)) return false; if (array_key_exists('query', $url) && $url['query']) { $path = $url['query']; do { $this->entry = zip_read($this->zip); if (!is_resource($this->entry)) return false; } while (zip_entry_name($this->entry) != $path); } else { $id = 0; if (array_key_exists('fragment', $url) && is_int($url['fragment'])) $id = $url['fragment']*1; for ($i = 0; $i <= $id; $i++) { $this->entry = zip_read($this->zip); if (!is_resource($this->entry)) return false; } } $this->length = zip_entry_filesize($this->entry); $this->position = 0; zip_entry_open($this->zip, $this->entry, $mode); return true; } public function stream_close() { @zip_entry_close($this->entry); @zip_close($this->zip); } public function stream_tell() { return $this->position; } public function stream_eof() { return $this->position >= $this->length; } public function url_stat() { return array('dev'=>0, 'ino'=>0, 'mode'=>0, 'nlink'=>0, 'uid'=>0, 'gid'=>0, 'rdev'=>0, 'size'=>$this->length, 'atime'=>0, 'mtime'=>0, 'ctime'=>0, 'blksize'=>0, 'blocks'=>0); } public function stream_read($count) { $this->position += $count; if ($this->position > $this->length) $this->position = $this->length; return zip_entry_read($this->entry, $count); }}stream_wrapper_register('zip', 'ZipStream'); ?>