Ulugbek
Ulugbek

Reputation: 141

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.

Upvotes: 3

Views: 1188

Answers (3)

Mortie
Mortie

Reputation: 404

change values

and restart your apache or nginx tu load changes

in ubuntu you can use this command to restart apache sudo service apache2 restart

Upvotes: 0

jack
jack

Reputation: 609

you should change max_input_time,upload_max_file_size and post_data_limit in php.ini file. It should work.

Upvotes: 0

parkway
parkway

Reputation: 276

<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

Upvotes: 2

Related Questions