CodeIgniter Forums
Set SQLSRV Timelimit/QueryTimeOut - Printable Version

+- CodeIgniter Forums (
+-- Forum: Development (
+--- Forum: Issues (
+--- Thread: Set SQLSRV Timelimit/QueryTimeOut (/thread-70004.html)

Set SQLSRV Timelimit/QueryTimeOut - robin - 02-07-2018

How do I set the TimeOut for EXEC the Query or Stored Procedure in SqlSrv PHP
Because i am using Codeigniter to call SQL-Server Stored Procedure.
For ex
"EXEC SP_Name"
some times its taking too long time, so the PHP page shows 500 Internal server error.

If any possible to set timeout in sqlsrv connection string or execution i have tried the below code

[b]$conn = sqlsrv_connect($host, array("UID"=>$user, "PWD"=>$pwd, "Database"=>"DBName", "LoginTimeout"=>5));
$result = sqlsrv_query($conn, $query, $params, array("QueryTimeout" => 30));[/b]

I have change the set_time_limit(25) also it taking more time

If possible to set the time limit the SP was stopped then i show the error description etc...

how do i fix this issue?

Thanks in Advance.

RE: Set SQLSRV Timelimit/QueryTimeOut - InsiteFX - 02-08-2018

PHP Code:
ini_set('mssql.timeout', 6);