If you run into issues with file size limits, then you may need to increase your file upload size limits. To do this there are two variable that need to be adjusted:
- post_max_size
- max_file_size
What Is “upload_max_filesize” in PHP?
The upload_max_filesize is a PHP variable in the system that limits the maximum allowable size of an uploaded file. For Reclaim Hosting customers the default value for upload_max_filesize is 150 Megabytes.
To successfully upload larger files, you may also have to adjust other variables like post_max_size.
What is post_max_size?
The post_max_size is used to set the maximum size for a single upload to the server. For Reclaim Hosting customers, the default value for post_max_size is also set to 150 Megabytes.
How to Modify the Values
If you need to increase your file upload size limits, you can modify the values for upload_max_filesize and post_max_size in cPanel > Software > MultiPHP INI Editor.
The next step is to select the domain you wish to modify the PHP settings for. Under Configure PHP INI basic settings select the home directory or a domain’s document root to open the corresponding PHP configuration.
We now have access to the PHP settings. Scroll down to post_max_size and upload_max_filesize and adjust the values as needed.
Once these have been updated, click Apply at the bottom of the page.
*It is important to note that applications, like Omeka, may have their own way to modify their internal file upload size. For Omeka it’s in the application's config.ini file. This is covered in a separate help article: Increasing Omeka Upload File Limits.
Increasing Memory Limit
PHP has certain limits that are used to keep PHP applications from monopolizing your allotted resources, and occasionally, a PHP application will hit these limits. Often, the limit the application hits is the memory limit, and it will need to be increased to avoid "out of memory" errors. While some PHP applications, like WordPress, have their own ways to do this, setting these limits in the appropriate php.ini
file should work for any PHP application.
The php.ini
is a file that configures how PHP works. This file can exist in your home directory to configure PHP across your account, or can exist in the directory of a domain to configure how PHP works on that specific domain. If a php.ini
file doesn’t exist in a domain’s directory, PHP will look for one in your home directory, and if one doesn’t exist there, PHP will use a default server-level php.ini
file.
Although you can write your own php.ini
file, by writing one using a text editor like vim or uploading one via SFTP/FTP, most users will find it simpler to again use the MultiPHP INI Editor in your cPanel under Software > MultiPHP INI Editor.
In the MultiPHP Editor, you will see a dropdown menu listing out all of the domains associated with your cPanel, and your home directory. If you want to increase the memory across your entire account, you can hit Home Directory but if you only need to increase it for a particular site, select that site.
Once you select a location, scroll down a bit, and you'll see memory_limit , and next to it a value in megabytes. You can adjust the value here (using M
, not MB
, when specifying the limit), and scroll down a bit more to hit Apply to save it. This will not only write the change to the php.ini
file, but .htaccess
as well.