Here’s how to enable both ZipArchive and GD Library in XAMPP for WordPress:
Step 1: Enable ZipArchive & GD in php.ini
- Open
C:\xampp\php\php.ini
in a text editor. - Uncomment these lines (remove the semicolons
;
):
;extension=zip → extension=zip
;extension=gd → extension=gd
For newer PHP versions, use:
;extension=gd2 → extension=gd2
- Save the file.
Step 2: Verify DLL Files Exist
Check these files exist in C:\xampp\php\ext
:
php_zip.dll
php_gd.dll
(orphp_gd2.dll
)
Step 3: Restart Apache
- Stop and restart Apache via the XAMPP Control Panel.
Step 4: Confirm Both Extensions are Active
- Create a
phpinfo.php
file inhtdocs
:
<?php phpinfo(); ?>
- Visit
http://localhost/phpinfo.php
and search for:
- ZipArchive → Should show “enabled”
- GD Support → Should show “enabled”
GD Library Troubleshooting
Issue 1: Missing Dependencies
GD requires additional extensions. Uncomment these in php.ini
:
;extension=exif → extension=exif
;extension=mbstring → extension=mbstring
Issue 2: Outdated GD Version
Update XAMPP or download the correct GD DLL for your PHP version from PHP for Windows.
Issue 3: Image Functions Not Working
Ensure these features appear in phpinfo()
under GD:
- FreeType Support (for fonts)
- JPEG Support
- PNG Support
Why WordPress Needs GD Library
- Image Processing: Resizing thumbnails, cropping, and editing media.
- Theme/Plugin Support: Required for image-heavy themes and plugins (e.g., WooCommerce).
- CAPTCHA: Used in login/comment forms.
WordPress Checks
- Go to Dashboard → Tools → Site Health.
- Verify no errors about ZipArchive or GD Library.
- Test image uploads in Media → Add New.
Final Fixes
- If extensions still don’t load:
- Reinstall XAMPP with the latest version.
- Use the XAMPP Add-ons page to install missing PHP extensions.
- For WordPress-specific workarounds, use plugins like:
- EWWW Image Optimizer (GD alternative)
- File Manager (Zip alternative)
Both extensions are crucial for WordPress core functionality.
Let me know if you need help with specific GD/Zip errors!