Open (& #39; F: test.zip & #39;, ZIPARCHIVE: Success & quot;); zip_close (); close echo & #39; OK & #39 ;;} else {echo & #39; failed & #39;} is such a very simple compressed code, but this error will occur! [Image description] (img. ask. csdn. netupload ziparchive compression php
Header ("Content-type: text/html; charset = utf-8 ");
/**
- Created by PhpStorm.
- User: Administrator
- Date: 2015/9/1
- Time: 10: 24 */
$ Zip = new ZipArchive (); // first instantiate this class
If ($ zip-> open ('F: \ test.zip ', ZIPARCHIVE: OVERWRITE === TRUE )){
$ Zip-> addFile ("1439879545372139963.jpg ");
Zip_close (); // Close
Echo 'OK ';
} Else {
Echo 'failed ';
}
This is a very simple compressed code, but this error may occur. I used the wamp integrated package environment. php is version 5.5 and does not need to enable php_zip.dll extension, after the output result is obtained, OK is output, that is, the zipArchive class is successfully created, so it should not be an extension problem. However, zipArchi always reports an error for the method and does not know the cause after searching for a long time, answer