How to extend request / connection timeout in Apache-FastCGI-PHP application using .htaccess

I am trying to extend the connection / request timeout on our dedicated server space.

The reason I'm trying to do is that for some operations in my application it takes more than 120 seconds, then the server does not wait for the operation to complete. It returns 500 Internal server error , exactly after 120 seconds.

To test this, I posted the below script on the server:

<?php
sleep(119);
echo "TEST";
?>

It will return the TEST to the browser after 119 seconds.

But when I put below script:

<?php
sleep(121);
echo "TEST";
?>

It will return 500 Internal server error after 120 seconds

we set Max_execution_time = 360 in php.ini, but the problem still exists.

Apache FastCGI.

360 , .htaccess, , .

?, Advance.

+3
2

Fastcgi - ; set_time_limit . , .htaccess, , , IPCCommTimeout; .htaccess, , .

. apache fcgid; , FcgidIOTimeout.

, 120 , -; , script PHP CLI.

+6

, , :

set_time_limit(int seconds)
-4

Source: https://habr.com/ru/post/1778075/


All Articles