# ZipArchive::extractTo(): Failed to extract zip archive '/tmp/upload_abc123.zip': ZipArchive::ER_CRC error in /var/www/app/src/Import/ZipImporter.php on line 42

- **ID:** `php/zip-archive-corrupt-archive`
- **Domain:** php
- **Category:** data_error
- **Error Code:** `ZipArchive::ER_CRC`
- **Verification:** ai_generated
- **Fix Rate:** 70%

## Root Cause

The ZIP archive is corrupt or incomplete, often due to a failed upload, truncated download, or disk write error, causing CRC checksum mismatches during extraction.

## Version Compatibility

| Version | Status | Introduced | Deprecated |
|---------|--------|------------|------------|
| 7.4 | active | — | — |
| 8.0 | active | — | — |
| 8.1 | active | — | — |
| 8.2 | active | — | — |
| 8.3 | active | — | — |

## Workarounds

1. **Validate the ZIP file integrity before extraction using ZipArchive::open() with ZipArchive::CHECKCONS: $zip = new ZipArchive(); if ($zip->open($file, ZipArchive::CHECKCONS) !== true) { throw new Exception('Corrupt archive'); }** (85% success)
   ```
   Validate the ZIP file integrity before extraction using ZipArchive::open() with ZipArchive::CHECKCONS: $zip = new ZipArchive(); if ($zip->open($file, ZipArchive::CHECKCONS) !== true) { throw new Exception('Corrupt archive'); }
   ```
2. **Re-download or re-upload the ZIP file from the source, ensuring a complete transfer. Use checksums (e.g., MD5) to verify integrity.** (90% success)
   ```
   Re-download or re-upload the ZIP file from the source, ensuring a complete transfer. Use checksums (e.g., MD5) to verify integrity.
   ```
3. **Use a command-line tool like 'unzip -t archive.zip' to test the archive, then repair with 'zip -F archive.zip --out fixed.zip' if possible.** (70% success)
   ```
   Use a command-line tool like 'unzip -t archive.zip' to test the archive, then repair with 'zip -F archive.zip --out fixed.zip' if possible.
   ```

## Dead Ends

- **** — CRC errors are data integrity issues, not resource limits. Increasing limits won't fix corrupted data. (95% fail)
- **** — If the source file is corrupt on disk, re-uploading the same file yields the same CRC error. (80% fail)
