There are a few common errors that occur in WordPress and other PHP-based programs that use the php.ini for certain settings. One of the most common of these settings is the maximum upload filesize (“upload_max_filesize“). This is a setting commonly found within a file known as the php.ini file.Â Here’s an example screenshot of a program with max file size limits exceeded during an upload attempt:
Error text: file_name” has failed to upload due to an error – This file exceeds the maximum upload size for this site.
You will need to increase the allowed memory in your php.ini file. The instructions below will show you on how to fix the php memory error by adjusting the appropriate sections of your local php.ini file.
Fixing the “Maximum upload size exceeded” Error
- Login to your cPanel.
- Scroll down to the FILES section of your Cpanel, and then click on the icon labeled FILE MANAGER.
- Use the File Manager to navigate to the web root. For more information on understanding your web root or document root, see What folder are my website files located within?
- Locate the php.ini file in your public_html folder. If you do not have one, our Technical Support team can place a default one in your account, or you can create a blank file by clicking on the New File icon and naming it php.ini so you can edit and add your own settings. Once you have a php.ini file, click on the file name to highlight it in the right side of the File Manager. If you need further information on editing with the File Manager editors, go to Using the File Manager Code Editor.
- Search the php.ini file for the following text:
; File Uploads ;
; Whether to allow HTTP file uploads.
file_uploads = On
; Temporary directory for HTTP uploaded files (will use system default if not
; Maximum allowed size for uploaded files.
upload_max_filesize = 128M
- Click the Save Changes button to save your changes.
The file_uploads should be set to “on” and “Maximum allowed size for uploaded files” should be set to the file size that you need.
This change affects all files within the directory that a php.ini is saved, unless the file is set to be recursive.Â If it is set to be recursive, then it affects all directories as per the setting in the .HTACCESS file.Â For more information, see How can I make my php.ini file recursive?
Thoughts on “Changing the upload_max_filesize in php.ini”
after increasing the upload file size I am still getting the error partially file uploaded though I have increased the size upto 4096M
It is likely the file upload is hitting a different server load limitation. I advise using a different file management method for uploading, such as FTP or SCP.
i have a problem this what can i do The file size exceeds the size allowed by the server. The limit is set to 8 MB.
In that case, you will need to contact your hosting support to see if that is something they are willing to change.
You may have to make the changes recursive, so it will affect the child folders. You can also verify the changes are successful with a phpinfo page.
Always hilarious when some noob comes on a forum declaring that something is “absurd” and then proceeds to lay out all the ways he’s ignorant and clearly not a dev and should never BE a dev (with that attitude).
How about just admitting “i don’t know jack shit. this seems not to make sense, therefore there’s something i’m missing” instead of declaring with no knowledge whatsoever that something is “absurd”
People like you trying to making websites is absurd. Go lick a window.
I tried this process bit I am still getting file is too large message. what other solution do i have. i am just trying to upload PFD with 8MB size
It may be more efficient in your case to use FTP.
My project is to upload a video with a maximum file size of 3 GB but it’s not uploading. I am changing my php.ini file, and manually linking the page. I need help.
Kuldeep, 3 GB is very large to be able to upload via PHP. If your account is on some sort of shared hosting, your host may not even allow uploads of this size. I recommend that you upload your file with FTP.
Hello, I have set the php.ini as stated above and set the file to be recursive however My maximum file upload size is being set to 8mb. When I set a size limit of less than 8 it changes the value on my WP site, but anything above 8m will default back to 8mb on my site.
If you are in a shared server, it’s possible there is a server default upload limit. For example, a shared server at any given hosting company can have a few hundred customers on one account. If each customer were allowed to upload large files (over a GB or more) then there would be a serious resource crunch.
Absurd. Every person who uses it needs to upload wordpress themes and the default setting is smaller than most themes. Why? Why doesn’t your article address how large can it be? Why is it set so small? What does 512m even mean? Does that mean 512MB? Why can’t you just take 5 minutes and write a meaningful explanation.
php.ini is not made for WordPress, it is a general configuration file set for php. WordPress just happens to be one of thousands of programs that are coded in php. As for a max size, you should not make it any larger than is needed. You COULD make it 1GB if you wanted (1000M) but you may have to move to a VPS or Dedicated server if you were using that many resources. Yes, 512M means 512 MB. 1G means 1GB. The php.ini file just doesn’t have the need for the B at the end.
So far no one else has notified us of any confusion, so we are not sure where this is occurring. We are happy to expand or make the article more clear if you can tell us exactly where you are getting confused. This of course goes for anyone.
On my webserver, I can’t find a ‘php.ini’ file. I created one, and copied the code snippet from this page, but it hasn’t increased the file size.
Sorry for the problems with the PHP.INI file. The problem may be the file itself (based on its entries), or that the file is not applying to the installation. Try making the file recursive. We have a tutorial that can show you how to do this. If that doesn’t help, then please submit a verified support ticket to have the php.ini file placed in your account.
If you have any further questions or comments, please let us know.
First am a creative designer and not a teche guy… but i use to work with the help of google. when i tried to upload a theme it says excwwds the upload limit 2M. and tried to solve it the way it is mentioned. But PHP.ini file was missing in my folder. then i created it and copied the code which is given here and changed the limit alone and saved it. But still it is showing me the same error. Can u pls help me to take it through.
Did you also make sure the php.ini file is set to be recursive?
hello i am using root ssh server i change upload size in my php.ini but still i can’t upload more than 2M :/
It’s possible that you have a PHP.INI file that is local to your installation, or one that’s sitting on top of your installation that is redundant and affecting all of your installation. Please check for that. If you continue to have the problem, if you are a customer of InMotion we can look at your installation to see if there are any errors being generated, but we would need some account information.
I hope that helps to answer your question! If you require further assistance, please let us know!
i am using WAMP. Thanks
Sorry for the problem with WAMP. We unfortunately do not support it as it involves the use of a server outside of the typical hosting environment. Our answers are based on a hosting server installation. Typically, in order to upload files (like graphics), you would need to know how to use FTP – that would be the best way to put files into the website.
If you have any further questions or comments, please let us know.
I am using WAMP SERVER. Thanks alot. Please any idea how to upload sample_data contating pictures and media in general to a wordpress theme like interior woo commerce. Thanks.
Please what if i am using my PC as local host, how do i solve this same issue?
What are you using as your webserver on your localhost?