Question

How to edit wp-condig.php file in DigitalOcean?

Hello.

I cannot upload my WordPress backup file because it is 135 MB. I want to increase the upload size from the wp-config.php file.

Can anyone tell me how to edit the file? Please help me ASAP. Thanks in advance.


Submit an answer


This textbox defaults to using Markdown to format your answer.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

Sign In or Sign Up to Answer

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

alexdo
Site Moderator
Site Moderator badge
August 15, 2022

Hello @vamsisnorkler

This question was answered some time ago in the community, I’ll leave the link to the question below

https://www.digitalocean.com/community/questions/increase-max-filesize-for-wordpress-files-one-click-installation

@Sternenfisch

WordPress relies on your PHP configuration, so if PHP isn’t configured to allow uploads of that size, WordPress will throw an error.

You’ll want to modify your PHP’s php.ini file and change:

upload_max_filesize

and

post_max_size

The defaults are 2MB and 8MB, so we can adjust those to something higher for your needs. I’d set them as:

upload_max_size = 64M

and

post_max_size = 96M

If you’re using NGINX instead of Apache, there’s a variable in NGINX’s main configuration file that you may also need to change as it also limits the size of uploads, that’d be:

client_max_body_size

You’d need to define that and set it to 64M as well.

client_max_body_size 64m;

You’d then restart Apache, or restart both NGINX and PHP-FPM. It just depends on which you’re using.

Regards

KFSys
Site Moderator
Site Moderator badge
August 13, 2022

Hi @vamsisnorkler,

In order to increase the upload size of your WordPress installation, you need to edit the php.ini of your Droplet and increase two values - upload_max_filesize and post_max_size.

If you do not know how to access your php.ini, SSH to your Droplet get into your website’s directory:

  1. cd /path/to/website
  2. touch info.php

Once you create the info.php file, open it and type in the following:

<?php phpinfo();

Save the file and exit. Next open it in your browser like so - https://example.com/info.php

where example.com is your domain name.

In there you’ll see the loaded configuration path. Once you see it, copy it and in your SSH type in

  1. nano /the/copied/path/of/php.ini

In there increase the values of both upload_max_filesize and post_max_size. Once done, save the file and exit.

One last thing to do is restart Apache

  1. service apache2 restart

That should be it.

Thanks for your responses.

Try DigitalOcean for free

Click below to sign up and get $200 of credit to try our products over 60 days!

Sign up