Increase the Maximum Size of Uploading

With AMI Amimoto, the maximum size of uploading is limited to 4MB by settings of Nginx and PHP.
To change the settings, connect to the instance with SSH and modify as follows:
(FYI: Access to the Amimoto instance by SSH )

Also, you need the root authority. su - and edit it as the root user or put sudo before every command to edit as the root user.
To become the root, you need to set the root’s password. Change the password by sudo passwdfirst.

Increase the Maximum Size of Uploading Capacity of Nginx

Using the vi editor, modify /etc/nginx/nginx.conf.

 client_max_body_size 4m;

Look for the above and change the size.
For example, increase the size to 32MB, change as follows:

 client_max_body_size 32m;

Then restart Nginx to reflect the changes.
Please run the following command in the terminal connected with ssh.

# service nginx restart;

Increase the Maximum Size of Uploading Capacity of PHP

Using the vi editor, modify /etc/php-fpm.d/www.conf.

php_admin_value[upload_max_filesize] = 4M
php_admin_value[post_max_size] = 4M

Looking for the above and change the size.
For example, increase the size to 32MB, change as follows:

php_admin_value[upload_max_filesize] = 32M
php_admin_value[post_max_size] = 32M

Then restart PHP to reflect the changes.
Please run the following command in the terminal connected with ssh.

# service php-fpm restart;

Now the maximum size of uploading will be increased.

Have more questions? Submit a request

0 Comments

Please sign in to leave a comment.
Powered by Zendesk