Error occurred when ziparchive-PHP adopts zipArchive class to compress file?

Source: Internet
Author: User
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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.