How to change the maximum Upload Size for WordPress (One-click Apps)

2022-03-28 By Nathan 3906 Views linux wordpress upload size
6 reviews

This tutorial is applicable specially for the one-click Apps i.e One-click WordPress installation based on Ubuntu in LayerStack Cloud Servers.

At times, there will arise a need to upload files that are larger in size to the WordPress application, however, this may be interrupted because of default restrictions on the maximum file size that can be uploaded.

This tutorial helps in overcoming this restriction and explains how to change the maximum upload size in the settings of WordPress.


Configuring Nginx


  1. Log in to the Cloud Servers via SSH or Console.

  2. Edit the Nginx configuration in the path /etc/nginx/nginx.conf.

    wordpresssize1

  3. Look for the variable client_max_body_size and assign the desired value to this variable and save it. Here we give a value 1024m.

    client_max_body_size 1024m
    

    wordpresssize2

  4. To make the changes in the Nginx configuration file, it is always required to restart the Nginx.

    # systemctl restart nginx
    

    wordpresssize3


Configuring PHP


  1. WordPress uses 7.4 as the default PHP version therefore, the PHP configuration /etc/php/7.4/fpm/php.ini needs to be updated with the desired values.
  • Edit the post_max_size variable to the desired limit

  • Edit the upload_max_filesize variable to the desired limit


    In the below example, the default value 100M has been replaced by the value 1024M:

    • post_max_size = 1024M

    • upload_max_filesize = 1024M

      wordpresssize4

      wordpresssize5

      wordpresssize6


  1. Once done the changes, make sure to restart the PHP-FPM process.

    # systemctl restart php7.4-fpm
    

    wordpresssize7

  2. To verify the changes done, you may log in to the WordPress Administration panel (http://serverip/wp-login.php) and navigate to the following path.


    On the left-hand side, navigate to Tools and select Site Health option:

    wordpresssize8

  3. Click on the Info tab on the screen and from the options, expand the option Media Handling would be able to verify the changes.

    wordpresssize9

    wordpresssize10

    wordpresssize11

  4. As the screenshot implies the above fields will reflect the changes made in the PHP which reflect in WordPress.

  • Max size of post data allowed

  • Max size of an uploaded file

  • Max effective file size


Related Tutorials

What do you think about this article?

Rate this article
Need assistance?

Try this guide to receive free bundled services at signup on a new free account.

Sign Up

Your Feedback Is Important

We hope you’ll give the new products and updates a try. If you have an idea for improving our products or want to vote on other user ideas so they get prioritized, please submit your feedback on our Community platform. And if you have any questions, please feel free to ask in the Community or contact our Technical Support team.