← All field notes
CTO notes 1 min read

How to change default WordPress 2MB Upload on Self Hosted VPS php.ini

WordPress comes with 2MB upload size limit by default which needs to be increased if you want to upload files larger than that amount. The limit is set by your […]

WordPress comes with 2MB upload size limit by default which needs to be increased if you want to upload files larger than that amount. The limit is set by your hosts php.ini file.

Login to your VPS via SSH and change your upload_max_filesize to something bigger such as 10Mb. 

You can customize this script to suit your needs:

#!/bin/bash -ex
#change the path an create a variable or hardcode it below.
#phpfilepath=/etc/php.ini
sed -i ‘s/post_max_size = 8M/post_max_size = 200M/’ /etc/php.ini
sed -i ‘s/upload_max_filesize = 2M/upload_max_filesize = 200M/’ /etc/php.ini

Restart your Apache2 or Nginx services.

Check php info or login to WordPress and test it.

AS

Written by Alan Son

CTO judgment, grounded in delivery.

I build commercial AI products and help founders turn ambitious technical ideas into reliable production systems.

More about my work

Need an experienced technical partner?

Let’s work out the right next move.