I face a problem with uploading files in php script on an external server wich I have no privileges to edit their files, with small files everything is ok but whene i try to upload a bigger file (not much 27Mb) after 5 minutes I get an error message:
Internal Server Error
The server encountered an internal error or misconfiguration and was
unable to complete your request.
I tried all the possible solutions:
add a php.ini file in the folder
add a .htaccess file
I change the following parameters:
max_input_time = 900
upload_max_filesize = 40M
post_max_size = 40M
memory_limit = 256M
I even tried set_time_limit(900) function in my script.
with all this changes when I use phpinfo() function I see that the time and the size are increased but I still have the timeout problem after about 300 seconds.
Is there a solution to this problem ?
Related
I am having a problem with uploading files bigger than a certain size (around 150MB/200MB) to my server.
Because I do not have this problem on my local server, I suspect it has something to do with settings on the shared server which I rent that runs Apache.
The error that I am getting is HTML error 413 Request Entity Too Large
Ofcourse I have done some research and found that the php settings on the server are set correctly as follows:
max_input_time = 24000
max_execution_time = 24000
upload_max_filesize = 2048M
post_max_size = 2048M
memory_limit = 4096M
max_input_vars = 2000
Furthermore, because the server runs on Apache, I made sure to also add
LimitRequestBody 2147483647 and
SSLRenegBufferSize 2147483647 to the .htaccess file which translate to 2GB for both settings.
For the code I just use the PHP move_uploaded_file($_FILES["video"]["tmp_name"], "../videos/". $newVideoName)) method which, one again, does work with smaller files.
Is anyone familiar with this problem or have any other solutions on how to fix this problem? I did talk the my host and they have said that there aren't any restriction on uploaded filesizes other than the PHP settings which I have changed.
Thanks upfront!
I have an AWS ec2 server setup which is running php 5.6.40 and has following settings
max_execution_time : 3000
max_file_uploads : 50
max_input_time : 600
max_input_vars : 1000
post_max_size : 1000M
upload_max_filesize : 100M
but the file upload is not working. I have putted a simple die in the controller function which displayed when small files are uploaded. but shows ERR_CONNECTION_RESET when using large files greater than 324KB.
I have debugged the code fully it has some conditions in most situations if the file is uploaded successfully within 25-30 seconds the later code runs successfully if the internet is little fluctuating and not able to upload 324KB it shows me an error for that also. I have also checked there is nothing wrong with the code it is working fine on other server.
I have fetched the values of ini in the PHP code so that I get the exact value after overwrite through ini_get_all()
Got the solution the issue is with the apache. I have apache 2.4.39 installed and it is not including the setting in the httpd.conf in installation so need to put it manually and restart the server.
RequestReadTimeout header=20-40, MinRate=500 body=20, MinRate=500
Thanks to the AWS support for this help.
I have a dedicated server Linux WHM/Cpanel that hosts a video streaming website. I have a form to upload videos and I've been trying to upload larger files but failing? I've checked error logs and nothing is leading me in the right direction. Below are my php.ini settings
upload_max_filesize = 1200M
post_max_size = 1200M
max_input_vars = 1000
memory_limit = -1
max_file_uploads = 20
max_execution_time = 7200
max_input_time = 7200
max_input_vars = 1000
I can upload a 100MB file just fine but the movies i have can be up to 1gb. I'm using Plupload to upload files. I've tested several small size files and they upload fine. When I try to upload large movies e.g. 300mb, Plupload returns this error HTTP Error. Upload URL might be wrong or doesn't exist. and this is the only clue I have. Plupload uses chunking to split up large files also.
This only happens with larger files. It's really a nuisance also, since I have to upload large files all over again to see if my changes are successful or not.
Any ideas? Why would it work with a smaller size file but not larger? I have no errors to work from.
HTTP Error is common when there is something wrong with the files being uploaded. Please check your server info with php.ini
upload_max_filesize is the limit of any single file.
post_max_size is the limit of the entire body of the request,
Sometimes the server requires post_max_size greater than upload_max_filesize I might be wrong but I have to check.
Try debugging the issue removing the chunking first and then later add the chunking part when you remove those HTTP errors.
I am facing a read timeout problem from couple of days.
There is a facility to upload users in my application (Xls,xlsx are allowed extensions). This is completely admin panel.
I am using PHPExcel for reading the data from the sheet and inserting each row details into database on the fly.
Here, there is a possibility to upload large size files. Right now the file I am having is 16MB file which contains nearly 200k records.
I have increased below configurations through htaccess
php_value memory_limit 1024M
php_value max_execution_time 259200
php_value max_input_time 3000
php_value post_max_size 700M
php_value upload_max_filesize 100M
I have placed set_time_limit(0) in the specific controller also.
My problem is read timeout in production environment. It is executing for around 15 mins and returning the below error
The requested URL could not be retrieved
While trying to retrieve the URL: http://example.com/upload/url
The following error was encountered:
Read Timeout
The system returned:
[No Error]
A Timeout occurred while waiting to read data from the network. The network or server may be down or congested. Please retry your request.
Will Keep Alive do something here. It is set to 5 in production and Apache timeout is 300.
I have searched many of the similar errors post in this site but no luck
I am planing to set a cron job, uploading the files only from front end. Hope that will solve this but I also want to know what factor is causing this error.
I want to upload upto 10GB files using a normal php form. But even after increasing the below values,
upload_max_filesize
post_max_size
php_value upload_max_filesize
php_value post_max_size
request_terminate_timeout
FcgidMaxRequestLen
am able to upload a file upto 3.5gb without any problem. But above that am getting an error as "upload_err_partial". I also reffered a lot of site but the answer I thought releavant was adding "header(connection:close)". I added the line but still I did not get any result. Could anyone guide me in this.
This error usually means that the uploading is cancelled by the user , and some times it can be server problem also which can cause this. Try to contact to your hosting provider and see what can he do