How to Increase WordPress File Upload Limit in Moss.sh

2 mins read

We have divided the tutorial into 2 parts.

Here is a quick guide explaining on how to increase the default file upload limit (10MB) in WordPress sites which are installed via Moss.sh service.

Part 1:

1# Log into your server as user moss

ssh moss@yourserverip

2# Run sudo su

3# Run cd /etc/openresty/
ls
and then press Return. Now you will be presented with files listed in the DIR. You will be able to see a file name mentioned server_params.username

4# Run

cat server_params.inspirefusion

Replace inspirefusion with your username. You should be able to see something like below:

5# Run

cat server_params.inspirefusion

Replace inspirefusion with your username. Then you’ll be prompted for more input. Copy & paste below text if you want to increase your file upload limit to 25MB:

# Extra nginx params to be included in this site managed by Moss
# all directives below will be included within 'server' blocks
# common configs that you might want to fine-tune are given

# Core module
# https://nginx.org/en/docs/http/ngx_http_core_module.html
#

client_max_body_size 25m;

# Gzip module
# https://nginx.org/en/docs/http/ngx_http_gzip_module.html
#
gzip on;
gzip_disable “msie6”;
gzip_comp_level 5;
gzip_min_length 256;
gzip_types application/javascript application/rss+xml application/x-javascript application/xhtml+xml application/xml text/css text/javascript text/plain text/xml;
EOF

Press Return

6# Check if the config file is as it should be:
cat server_params.inspirefusion
Replace inspirefusion with your username.

7# exit

Part 2:

1# sudo su

2# cat <<EOF >> /etc/php/7.2/fpm/conf.d/99-extra.ini
You will be prompted for more input:

3# upload_max_filesize = 25M
post_max_size = 25M

EOF

4# Verify changes:
cat /etc/php/7.2/fpm/conf.d/99-extra.ini

5# Goto your moss.sh account and visit the sites section and select the site for which you just mades the above changes. Click “reprovision”