Set unlimit time for request in server

PHP

In server, each request has been limit around time.
So, if you run a function have long time, it will raise to errors only appear in server environment as:
“500 Internal Server Error”
“server timeout”

Set unlimit time for request in server

Example:

function test() {
    //content code and long process
}

 

Both error above will stop process and don’t any response.
To fix for this function, please set below code to first line in that function,
it also can set to files to run functions in file.

From the example:

function test() {
    ini_set('memory_limit', '-1');
    //content code and long process
}

 

Set before line in function: ini_set(‘memory_limit’, ‘-1’);
Value: -1 will set unlimit time for process

Thereto, you can set a other value as: 16M, 32M, 64M, 128M,..