I am using a server hosted by GoDaddy, But when I post data of size greater than 1MB it returns a 413 "Request Entity Too Large" response. I cannot find the httpd.conf file and cannot affect the .htaccess changes. How can I increase the LimitRequestBody to 50MB.
I am using shared hosting.
Here's a screenshot of the response I get:
If you are having shared hosting plan with godaddy, as of right now, I just tested, maximum LimitRequestBody have to be set at 500kb.
Seems like used to be 1MB.
And, based on what I googled, you need to move to the dedicated server in order to modify these settings.
I would say the problem lies in your php configuration. There are two settings for file size limitation:
upload_max_filesize = 10M
post_max_size = 10M
These settings are normally found in the php.ini file. Since I have no experience with your kind of hosting I would not know if you can change it, but if you have access to the php.ini or have some other means of overriding php settings you can follow this post on StackOverflow on how to do this.
By running phpinfo you can at least find out what the current settings are and see if this is causing the issue.
Here is how to increase the file size limit in your PHP.ini file: https://support.godaddy.com/help/article/1409/increasing-user-file-upload-limits-using-php-ini-on-your-linux-server
Related
I'm using Godaddy linux share hosting, and using the php.ini to configure the file upload max size
file_uploads = On
post_max_size = 100M
upload_max_filesize = 100M
but this is not working, the max filesize that allow is 2mb, although i configure already, i have tried the "php5.ini", "php56.ini" and store it in "/public_html/" or "root" folder, it still not working, at first i suspect it is the problem of SSL, because i just install SSL 2 weeks ago, but i found that my another hosting account(no SSL installed) that i configured before and tested before and show it is working correctly also have same problem,
Can i know what problem? is it only me encounter the this problem? and how to fix it?
I found the answer, we can straight away change the max upload size in system, follow this tutorial, https://www.youtube.com/watch?v=YmS92xfmbFU
I can't upload more than 8 MB files in PHP. I have added below lines in .htaccess file.
php_value upload_max_filesize 2048M
php_value post_max_size 2048M
This is working on localhost but not working on live server. I have contacted the support team of server and ask them to give rights to edit php.ini file but said you haven't any permission to update php.ini file.
Please help me regarding this issue.
Your webhost probably does not allow php.ini to be overridden by .htaccess. This is common on shared hosting. If you need to do large uploads you need to find a host that supports it or get a VPS.
There are some upload libraries which support partial/chunked upload, you can circumvent hoster restrictions with that, cause it uses multiple requests to upload one file. I use something like https://github.com/blueimp/jQuery-File-Upload most of the time when i have to handle big uploads.
I have a client with a site (built with Kohana framework) which has a chunking file uploader that after upload then posts the file to vimeo for conversion. Problem is that although the file is uploaded successfully to the server, it then errors when sending it on to vimeo. My suspicion is that this post to vimeo is hitting a limit which the first stage chunking uploader avoids.
What settings in the PHP.ini should I be changing to fix this.
The video files are up to 2GB in size.
Update:
In answer to your questions this is a 500 error. I have no more than that due to the fact it only happens on the live server and not on staging and testing. I have been told not to turn on the display_errors for PHP as this will show errors on the live site (which do occur apparently) also this is not my code.
There is a limit to vimeo videos of 500MB for basic accounts as seen here. I'm guessing the kind of account that your server is registered with is that, basic, even when your coumputer might be registered with a plus account. You'll need to check how to connect with a server using your plus account or restrain your videos size to 500MB.
With more information we would be able to provide better answers.
you can try the following in your .htaccess file you can increase or decrease the value accordingly, by default php sets the max file upload limit to 8M
php_value upload_max_filesize 20M
php_value post_max_size 20M
php_value max_execution_time 200
php_value max_input_time 200
OK everyone, thanks for the answers. Turns out the issue was not with any of the limits but instead was a problem with the file chunking routine and an error reporting the sizes of the chunks sent over to Vimeo. This was only an issue on the live server which was RedHat 4.1 and not on any of the staging or testing machines. A temporary fix has been done by removing the size verification while we find the issue. Thanks for all your help.
I am trying to upload large files through my cms and was wondering how to change the php.ini file for heart internet.
Is this possible in shared hosting, if not are there any other work arounds?
Thanks in Advance
To override settings all you need to do is create either a php.ini or php5.ini file (if you are running PHP5) in your root directory. Then you can change settings like this:
upload_max_filesize = 20M ;
post_max_size = 20M ;
max_execution_time = 60 ;
This gives you maximum file size of 20MB and 60 second timeout.
As long as you keep this size within the allowed limits on your account, you can use this to increase the default size - which is 5MB.
It depends on whether your web hosting company allows you to override certain PHP settings or not. It might be possible to change some values but not others.
Secondly, the process for overriding settings differs depending on whether your hosting is IIS or Apache. If its Apache, try adding these two lines to your .htaccess file:
php_value upload_max_filesize 8M
php_value post_max_size 8M
This .htaccess file should do to the directory where your php upload script resides, or higher. I'd rather put it in the root directory.
Once done, create a php page containing this code:
<?php phpinfo( ); ?>
Compare the Local Value and Master Value of these settings to see if the changes are in effect.
There is no way to upload files over 50MB without breaking your terms and getting your account shutdown.
However if the terms were different, you could split the file into parts and join them together on the server side.
I moved away from heart internet and got my own server for this exact reason as they wouldn't even let me pay a premium to get the restriction removed (restricted from there end I think)
If it is shared hosting you probably won't be able to, I have also discovered that you cannot use ini_set to set the correct settings because the file upload occurs before your script is executed. So if you want to accept large files via a form to a PHP script you have to use php.ini.
You might be a work around though, you could use an open FTP account, upload large files form there and code a bit of script to ask the user what file they have uploaded, then you can manipulate (move / rename) to your hearts content.
I have an image upload for a slideshow, and the users are continuously uploading files that are 2MB plus. Files under this size work fine, but files over the size cause what looks like a browser timeout.
Here are my php ini settings:
Max memory allocation: 12M
Max file upload size: 10M
Max HTTP Post size: 10M
Max execution time: 60
Max input parsing time: 120
These settings are in the configuration file itself, and I can change them directly. Changes show up when using phpinfo().
I am running on an apache server and php 4.3.9(client's choice, not mine). The apache server's request limit is set to default, which I believe is somewhere around 2GB?
When I use the firebug network monitor, it does look like I am not receiving a full response from the server, though I am not too experienced at using this tool. Things seem to be timing out at around 43 seconds.
All the help I can find on the net points to the above settings as the culprits, but all of those settings are much higher than this 2MB file and the 43 second time out.
Any suggestions at where I can go from here to solve this issue?
Here are relevant php ini settings from phpinfo(). Let me know if I need to post any more.
file_uploads On On
max_execution_time 60 60
max_input_nesting_level 64 64
max_input_time 120 120
memory_limit 12M 12M
post_max_size 10M 10M
safe_mode Off Off
upload_max_filesize 10M 10M
upload_tmp_dir no value no value
Make sure you have error reporting activated in php.ini: display_errors = On; this might give you a clue about what's going on. Production servers usually (should) have error reporting disabled.
I recently had a similar problem, and increasing the memory_limit setting worked for me. If you read files content into variables, each variable will take about as much memory as the file size, increasing the scripts memory requirements.
Where are those settings? If you're using .htaccess then your Apache configuration might not be allowing you to override those settings.
I'd suggest checking with a phpinfo() call if those settings are indeed being applied or not:
<?php
phpinfo();
?>
If it's a shared host, your host might have set a limit to override yours.
Otherwise, try making the POST limit higher than the file upload size. AFAIK, uploads are POSTED.
If the problem is due to the Host overriding your timeout, you can look for a host that still uses Apache 1: In Apache 1 the local .htaccess overrides the global setting even for the timeout.
Otherwise, there are dozens of Java applett uploaders available for just a few dollars (Google it). They split the file, upload the parts and put the parts back together transparently.
This is a guaranteed fix for timeout, and has the added advantage of letting users pause and resume their upload, see the progress, et all.
(Flash based uploaders don't have this advantage.)