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

- **ID:** `php/ziparchive-crc-error`
- **Domain:** php
- **Category:** data_error
- **Verification:** ai_generated
- **Fix Rate:** 75%

## Root Cause

The ZIP archive has a CRC32 checksum mismatch, indicating file corruption during upload, download, or storage.

## Version Compatibility

| Version | Status | Introduced | Deprecated |
|---------|--------|------------|------------|
| PHP 8.1 | active | — | — |
| PHP 8.2 | active | — | — |
| PHP 8.3 | active | — | — |

## Workarounds

1. **Validate the ZIP file using 'unzip -t' on the command line before processing, and request a fresh upload from the user if it fails.** (80% success)
   ```
   Validate the ZIP file using 'unzip -t' on the command line before processing, and request a fresh upload from the user if it fails.
   ```
2. **Use ZipArchive::open() with ZIPARCHIVE::CHECKCONS flag to detect corruption early and provide a user-friendly error message.** (85% success)
   ```
   Use ZipArchive::open() with ZIPARCHIVE::CHECKCONS flag to detect corruption early and provide a user-friendly error message.
   ```

## Dead Ends

- **** — Increasing PHP's memory_limit does not fix CRC errors, as the issue is with file integrity, not memory. (95% fail)
- **** — Re-uploading the same corrupted file will produce the same CRC error. (90% fail)
- **** — Setting ZipArchive::CHECKCONS to false may bypass the check but could lead to incomplete or corrupted extracted data. (80% fail)
