Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Increasing Execution Time for php

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.

like image 383
Ulugbek Avatar asked Jun 23 '26 15:06

Ulugbek


1 Answers

<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

like image 119
parkway Avatar answered Jun 25 '26 05:06

parkway