Update: This is not a dublicate question! I researched and tried many options/answers, but still, the web page is not allowing users to upload a file after exactly 20 seconds.
Update: I tried to switch from fast-cgi to php-fpm, but it did not work for me either. What else should I change in order to overcome timeout of 20 seconds?
When I am uploading large files via web browser, exactly after 20 seconds, it stops uploading. Specifically, approximately 40% of 100 MB file uploads fine during 20 seconds; I see the percentage of the upload under the Chrome browser. Then, the value of the percentage stops after 20 seconds and shows ERR_CONNECTION_RESET error. I checked logs, but there is nothing regarding the issue.
My php.ini configuration as follows:
max_execution_time 300000
max_input_time 300000
upload_max_filesize 500M
post_max_size 500M
memory_limit 1024M
max_file_uploads 30
Timeout 8000 (in apache2.conf)
LimitRequestBody 0 (in htaccess)
What else should I change in order to increase an execution time? Obviously, there is some config that does not allow to upload a file after 20 seconds. My assumption is that there is something in Apache Configuration that must be tuned.
<IfModule mod_php5.c>
php_value post_max_size 100M
php_value upload_max_filesize 100M
php_value memory_limit 100M
php_value max_execution_time 300000
php_value max_input_time 300000
php_value session.gc_maxlifetime 1200
</IfModule>
insert this in .htaccess file. try whether its working or not
you should change max_input_time,upload_max_file_size and post_data_limit in php.ini file. It should work.
change values
max_execution_time 25000
max_input_time 25000
memory_limit 500M
display_errors On ;to see where is problem
post_max_size 500M
upload_max_filesize 500M
and restart your apache or nginx tu load changes
in ubuntu you can use this command to restart apache sudo service apache2 restart
Related
I try to upload file to my own website when I try upload file with less than 1GB it's work fine, But when I try with large file give me message : "The connection was reset." ERR_CONNECTION_RESET
Then I try to edit and increase all value php.ini
php_value max_execution_time 10000
php_value max_input_time 10000
php_value max_input_vars 1000
php_value memory_limit 2000M
php_value post_max_size 2000M
php_value session.gc_maxlifetime 10000
php_value upload_max_filesize 2000M
In the end still have a problem
I work on my own server and I have access to whm, cpanel with centos 7
And there's no logs for this problem on apache logs
Can you check the features of the package you added on WHM? The quota of the package you have added may be low.
I am running a WordPress website, which runs CRON for very large data. Typically the CRON runs for 2 to 2:30 hours.
But from last 2 days, I am facing an issue like my CRON process is getting stuck after 5 minutes i.e. 300 seconds
I have tried to resolve this using the below solutions:
Added set_time_limit(0); in wp-config.php file.
define( 'WP_MEMORY_LIMIT', '4096' );
set_time_limit(300);
define( 'WP_MAX_MEMORY_LIMIT', '4096' );
Added php_value max_execution_time 18000 in .htaccess file.
<IfModule php7_module>
php_value max_execution_time 18000
php_value max_input_time 6000
php_value memory_limit 4096M
php_flag display_errors Off
php_value max_input_vars 1000
php_value post_max_size 8M
php_value session.gc_maxlifetime 1440
php_value session.save_path "/var/cpanel/php/sessions/ea-php72"
php_value upload_max_filesize 2M
php_flag zlib.output_compression Off
</IfModule>
In /etc/apache2/conf/httpd.conf file, increased the Timeout variable with value 5000
Increased value of FcgidBusyTimeout with 5000
None of the above solutions worked for me.
Anyone can help to find where is the problem with this cron or with other validation steps?
I have posted this to server support guys as well, and they came up with the solution.
Anyone having the same issue can try modifying values:
In my case, Filename: /etc/apache2/conf.d/lsapi.conf
lsapi_poll_timeout 18000
lsapi_backend_max_process_time 18000
After applying these changes, you need to restart the APACHE server for reflecting the changes.
Applying these changes worked for me.
I use Laravel 6.2. I try to upload a video. The size is ~700mb, but when I submit the form I receive the following error in Chrome:
The connection was reset
I tried to upload a video which has ~5mb size and it worked fine.
I disabled XCache, but it did not work.
P.s: Post_max_size and upload file size is 2gb
Try the following:
Apache: Edit your httpd.conf file, and increase max_execution_time as well as max_input_time:
<Directory "[path/to/this/directory]">
php_value upload_max_filesize 2000M
php_value post_max_size 2000M
php_value max_execution_time 600
php_value max_input_time 600
</Directory>
PHP: you can also increase time and size in your php.ini file:
post_max_size = 2G
memory_limit = 512M
max_execution_time = 36000
max_input_time = 60
Then, restart your Apache server and try again.
I'm trying to let user upload up to 30MB max but the server hangs not even produce an error. Not even error in browser network bar in inspection. I did changes below after reading whole lot of info on Internet but no luck so far. Anyone knows what else I can do?
Thanks in advance
.htaccess:
<IfModule mod_php5.c>
php_value post_max_size 40M
php_value upload_max_filesize 350M
php_value max_execution_time 1200
php_value max_input_time 1200
</IfModule>
/etc/php5/{cli,fpm}/php.ini
post_max_size 40M
upload_max_filesize 35M
max_execution_time 1200
max_input_time 1200
RESTART:
sudo service php5-fpm restart
sudo service apache2 restart
For others who could face this issue, there could be also Apache's ModSecurity setting SecRequestBodyLimit (in case of using Apache) and in system log you'll get the following error:
ModSecurity: Request body (Content-Length) is larger than the configured limit (10485760)
One thing to check is the maximum post size set in the PHP Suhosin security patch. This complements the settings in your php.ini and might cause the issues that you're seeing. A similar question here: https://serverfault.com/questions/486134/php-cant-increase-maximum-upload-limit
Let me know if it worked.
Scenario: Installed an adult tubescript for a pornsite. Keeps having problems with file upload over 8MB
I figured it has something to do with php.ini, so I checked and changed it to
post_max_size = 200M
upload_max_size = 200M
On .htaccess of the script, there is these two lines:
php_value upload_max_filesize 1000M
php_value post_max_size 1000M
but when I check using phpinfo(), post_max_size is still 8M and I still can't upload anything over 8MB. I've been working on this for 3 days now and I really can't figure it out.
What could possibly be causing this?
Dedicated Server: FreeBSD 8.2, Nginx 1.0.6, PHP 5.2
I've learned that Nginx needs a php feeder/loader: fastcgi
In my case it's spawn-fcgi
here's how I fixed it
/usr/local/etc/rc.d/spawn-fcgi restart
/usr/local/etc/rc.d/nginx restart
Thanks for the replies.
Credits to DarkZenith for the pointers.