phpconfig

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:

  1. Access your server via SSH, cPanel, or Plesk.

  2. Locate your php.ini file:

    • CentOS/RHEL/Fedora: /etc/php.ini
    • Debian/Ubuntu: /etc/php/[version]/apache2/php.ini
  3. Open the file and modify these values:

    ini
    upload_max_filesize = 100M
    post_max_size = 100M
  4. 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:

  1. Locate Apache’s config file:
    shell
    /etc/httpd/conf/httpd.conf
  2. Add or update this line:
    apache
    LimitRequestBody 104857600 # 100MB in bytes
  3. Restart Apache:
    shell
    systemctl restart httpd

3. Modify Nginx Configuration (nginx.conf Method)

For Nginx users, increase the limit in nginx.conf:

  1. Open /etc/nginx/nginx.conf.
  2. Add or modify:
    nginx
    client_max_body_size 100M;
  3. Restart Nginx:
    shell
    systemctl restart nginx

4. Alternative Method: Increase Upload File Size in WordPress Using .htaccess File

If you cannot access server files, try editing .htaccess:

apache
php_value upload_max_filesize 100M
php_value post_max_size 100M

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.

SHARE THIS POST

Leave a Reply

Your email address will not be published. Required fields are marked *

*

nineteen + 1 =