note 47864 rejected from ref.zip by betz
| From: | betz@php.net | Date: | Fri, 03 Dec 2004 15:01:17 +0000 |
| Subject: | note 47864 rejected from ref.zip by betz | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-81315@lists.php.net to get a copy of this message | ||
Note Submitter: ren dot hong-lai at yellowsheepriver dot com
----
hello,I'm a greener.
ON PHP WINDOWS SERVER:
1) Grab the php_zip.dll from the extensions dir in php-4.3.0pre2-Win32.zip
2) Add a line extension=php_zip.dll to your php.ini
3) Restart your web server
then,run test.php:
<?php
$zip = zip_open("test2.zip");
if ($zip)
{
while ($zip_entry = zip_read($zip))
{
echo "Name: " . zip_entry_name($zip_entry) . "\n";
echo "Actual Filesize: " . zip_entry_filesize($zip_entry) . "\n";
echo "Compressed Size: " . zip_entry_compressedsize($zip_entry) . "\n";
echo "Compression Method: " . zip_entry_compressionmethod($zip_entry) . "\n";
if (zip_entry_open($zip, $zip_entry, "r"))
{
echo "File Contents:\n";
$buf = zip_entry_read($zip_entry, zip_entry_filesize($zip_entry));
echo "$buf\n";
zip_entry_close($zip_entry);
}
echo "\n";
}
zip_close($zip);
}
?>
but,display:
Warning: zip_open() Cannot open zip archive test2.zip in C:\Program files\Apache
Group\Apache2\htdocs\TEST.PHP on line 5.
please tell me,how to do? thank you!