美好的一天。
我们有IIS7和Windows Server 2008 R2
当我们在服务器中使用php脚本时,我们会收到错误:
Error in query mainres enterres preparation/execution.
Array (
[0] => Array (
[0] => 08S01 [SQLSTATE] => 08S01
[1] => 258 [code] => 258
[2] => [Microsoft][SQL Server Native Client 11.0]Shared Memory Provider: Timeout error [258]. [message] => [Microsoft][SQL Server Native Client 11.0]Shared Memory Provider: Timeout error [258].
)
[1] => Array (
[0] => 08S01 [SQLSTATE] => 08S01
[1] => 258 [code] => 258 [2] => [Microsoft][SQL Server Native Client 11.0]Communication link failure [message] => [Microsoft][SQL Server Native Client 11.0]Communication link failure
)
[2] => Array (
[0] => 08S01 [SQLSTATE] => 08S01
[1] => -2147467259 [code] => -2147467259
[2] => [Microsoft][SQL Server Native Client 11.0]Communication link failure [message] => [Microsoft][SQL Server Native Client 11.0]Communication link failure
)
)
我们可以看到Shared Memory Provider: Timeout error
请告诉我如何在超时错误之前增加时间?
答案 0 :(得分:1)
此错误可能与php.ini
配置文件中的设置有关。
搜索以下项目并更改(增加)其值,例如:
max_execution_time = 600
max_input_time = 600
default_socket_timeout = 60
并且,如果您使用MSSQL Server:
mssql.connect_timeout = 60
mssql.timeout = 60
如果您使用MySQL服务器:
mysql.connect_timeout = 60
答案 1 :(得分:0)
<强>的php.ini:强>
max_execution_time = 300
max_input_time = 300
default_socket_timeout = 300
MSSQL Server:
mssql.connect_timeout = 300
mssql.timeout = 300
<强> IIS7:强>
P.S。:配置php.ini你也可以在经理iis7中更改