How to Increase upload_max_filesize and post_max_size in XAMPP (php.ini)
Google AdSense In-Article Display Placement
Publisher ID: ca-pub-XXXXXXXXXXXXXXXX (Configured in config.php)The default upload limit in XAMPP is 2MB or 40MB. To upload large themes, plugins, or SQL databases, you must adjust upload_max_filesize, post_max_size, and memory_limit in php.ini.
In XAMPP Control Panel, click "Config" next to Apache -> choose "PHP (php.ini)". Search for and change: upload_max_filesize = 128M, post_max_size = 128M, memory_limit = 256M. Save the file and restart Apache in XAMPP.
📋 Guide Table of Contents
1. Problem Diagnosis & Symptoms
Attempting to upload a WordPress plugin larger than the default limit yields "The uploaded file exceeds the upload_max_filesize directive in php.ini".
2. Primary Root Causes
- Cause: Default 2MB or 40MB PHP ceiling.
3. Step-by-Step Diagnostic Fixes
Update Directives in C:\xampp\php\php.ini
Edit php.ini with these proportional values:
upload_max_filesize = 128M
post_max_size = 128M
memory_limit = 256M
max_execution_time = 300
4. How to Verify the Resolution
- Check phpinfo() or WordPress Media Upload screen.
5. Diagnostic Troubleshooting Matrix
| Symptom Observed | Root Cause | Recommended Action |
|---|---|---|
| Upload still capped at 2MB after editing php.ini | Apache was not restarted after saving php.ini | Stop and Start Apache in XAMPP Control Panel |
6. Critical Mistakes to Avoid
- ❌ Setting post_max_size smaller than upload_max_filesize.
7. Frequently Asked Questions
❓ Can I set upload_max_filesize to unlimited?
No, setting it too high without memory limits can cause server crashes on large uploads.
Official Technical References
Google AdSense In-Article Matched Content Unit