By Vamsi
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.
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!
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:
- cd /path/to/website
- 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
- 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
- service apache2 restart
That should be it.
Hello @vamsisnorkler
This question was answered some time ago in the community, I’ll leave the link to the question below
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
Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.
Full documentation for every DigitalOcean product.
The Wave has everything you need to know about building a business, from raising funding to marketing your product.
Stay up to date by signing up for DigitalOcean’s Infrastructure as a Newsletter.
New accounts only. By submitting your email you agree to our Privacy Policy
Scale up as you grow — whether you're running one virtual machine or ten thousand.
From GPU-powered inference and Kubernetes to managed databases and storage, get everything you need to build, scale, and deploy intelligent applications.