‹ Articles

How to Increase File Upload Limits in PHP

If you receive errors when uploading files or images to your app, you can increase the file size upload limit by changing your app's PHP settings.

Create a file named .user.ini in your app's web root directory:

Using a .user.ini file is the best and safest way to customize PHP settings for an APP. Unlike modifying global configuration files, using a .user.ini file can't break your server.

You will most likely want to change your app's upload_max_filesize or post_max_size or both.

To do so, enter the following lines in your .user.ini file:

upload_max_filesize = 700M
post_max_size = 100K

where 700 and 100 are changed to the values you need to set for your app while M and K are changed to the measurements in MB or KB.

For information on changing other PHP settings, check out our tutorial on using .user.ini files.

Last updated: January 20, 2017

Still Have Questions?

Don't hesitate to contact us if you can't find the answers to your questions.