
If you are struggling to increase max upload file size in WordPress, you’re not alone. By default, WordPress follows your server’s PHP configuration, which limits the file size you can upload. In this guide, we will show you how to change this setting on your PHP, Apache, or Nginx server to allow larger file uploads.
Why Increase the Max Upload File Size?
WordPress users often need to upload large images, videos, themes, or plugins. If you receive an error like “The uploaded file exceeds the upload_max_filesize directive in php.ini,” it means your server restricts file sizes. The solution? Modify your PHP configuration to allow larger uploads.
1. Change PHP Configuration (php.ini Method)
To increase the upload limit, you need to edit the php.ini file.
Steps to update php.ini:
-
Access your server via SSH, cPanel, or Plesk.
-
Locate your php.ini file:
- CentOS/RHEL/Fedora:
/etc/php.ini
- Debian/Ubuntu:
/etc/php/[version]/apache2/php.ini
- CentOS/RHEL/Fedora:
-
Open the file and modify these values:
-
Save the file and restart your web server.
2. Adjust Apache Configuration (httpd.conf Method)
If you use Apache, you also need to modify the httpd.conf
file:
- Locate Apache’s config file:
- Add or update this line:
- Restart Apache:
3. Modify Nginx Configuration (nginx.conf Method)
For Nginx users, increase the limit in nginx.conf
:
- Open
/etc/nginx/nginx.conf
. - Add or modify:
- Restart Nginx:
4. Alternative Method: Increase Upload File Size in WordPress Using .htaccess File
If you cannot access server files, try editing .htaccess
:
Save the changes and check if the new limits apply.
Final Thoughts On Increase Upload File Size in WordPress
By following these steps, you can successfully increase max upload file size in WordPress and avoid errors when uploading large files. If your changes don’t take effect, double-check your server settings and restart the web service.