(mt) Media Temple makes a concerted effort to ensure the accuracy of this content. However, if you discover any issues, please open a support request via the (mt) AccountCenter.
The publishing of this information does not imply support of this article. This article is provided solely as a courtesy to our customers.
PHP upload limits
The current default PHP upload limits on your WordPress Hosting are currently set to the following.
- upload_max_filesize = 64M
- post_max_size = 64M
Raising your PHP limits
Normally, you would find these settings within your php.ini file. On the WordPress Hosting service, these limits my be adjusted within the .user.ini file. If this is the first time you are trying to modify these limits, you will need to create a file named ".user.ini" within the webroot or ".../html" directory. Once the file is created, you may add the following lines to set the php limits. These variables may be increased to meet your needs. However, it is recommended that the values are not increased beyond 256M.
upload_max_filesize = 128M
post_max_size = 256M
Once you make those changes and save the file, that's all you need to do. The Apache web server doesn't need to be restarted on the WordPress Hosting service.
Additional information
If the upload_max_filesize is larger than post_max_size, you must increase post_max_size so that it is bigger than upload_max_size.
Resources
(mt) Media Temple makes a concerted effort to ensure the accuracy of this content. However, if you discover any issues, please open a support request via the (mt) AccountCenter.
The publishing of this information does not imply support of this article. This article is provided solely as a courtesy to our customers. Please consult our Statement of Support for further information.
Symptom
I am unable to upload larger files with PHP scripts.
You are able to upload small files via PHP, but larger uploads fail. Or, you receive an error message like "Allowed memory size of 103809024 bytes exhausted (tried to allocate 0 bytes)".
Solution
PHP has several configuration options to limit resources consumed by scripts. By default, PHP is set to allow uploads of files with a size of 2MB or less.
Try increasing the following values in your php.ini file, for example:
memory_limit = 99M
max_execution_time = 300
upload_max_filesize = 20M
post_max_size = 24M
On the Grid, once you make those changes and save the file, that's all you need to do. The Apache web server doesn't need to be restarted (and, to be clear, you don't have that level of access on the Grid platform).
If you're unsure how to modify your php.ini, please click here for detailed instructions.
Additional information
If the upload_max_filesize is larger than post_max_size, you must increase post_max_size so that it is bigger than upload_max_size.
If the value of post_max_size is larger than memory_limit, you must increase memory_limit so that it is larger than post_max_size.
Resources
READ ME FIRST
This article has been mirrored from the Parallels Knowledge Base as a courtesy to our DV server customers. As they are the authoritative source of the information covered in this topic we encourage you to check their original article since this content is subject to change.
(mt) Media Temple makes a concerted effort to ensure the accuracy of this content. However, if you discover any issues, please open a support request via the (mt) AccountCenter.
The publishing of this information does not imply support of this article. This article is provided solely as a courtesy to our customers. Please consult our Statement of Support for further information.
Symptom
I am unable to send attachments via webmail or upload big files with PHP scripts.
You are able to upload small files in webmail or with a PHP script, but larger files cannot be uploaded or you get "The page cannot be displayed" error when you push the "Send Message" button. If error reporting is enabled, you receive the "Allowed memory size of 8388608 bytes exhausted (tried to allocate 0 bytes)" or "Request Entity Too Large" error.
Solution
PHP has several configuration options to limit resources consumed by scripts. By default, PHP is set to allow uploads of files with a size of 2MB or less.
Try increasing the following values in php.ini, for example:
memory_limit = 32M
upload_max_filesize = 24M
post_max_size = 32M
There are multiple ways to edit php.ini on your DV server. This KnowledgeBase article outlines how to do so:
After making these changes, you may need to restart Apache. You can do so through Plesk or via SSH with the following command:
/etc/init.d/httpd restart
Additional information
If the upload_max_filesize is larger than post_max_size, you must increase post_max_size so that it is bigger than upload_max_size.
If the value of post_max_size is larger than memory_limit, you must increase memory_limit so that it is larger than post_max_size.
Comments