简体   繁体   English

php mysqli连接的最长时间是多少

[英]What is the maximum time of a php mysqli connection

I have a long running php script that sends out emails and updates the database. 我有一个运行时间长的php脚本,可以发送电子邮件并更新数据库。 The script takes about 45 minutes to complete. 该脚本大约需要45分钟才能完成。 I have a progress indicator in which I can see on which iteration of the loop problems could occur. 我有一个进度指示器,可以在其中查看循环问题的哪些迭代。 Always after about 12 minutes an error unknown error occurs. 总是在大约12分钟后,会发生未知错误。 There's no problem with the mailing script. 邮件脚本没有问题。 It looks to me like the mysql database connection is dropped. 在我看来,mysql数据库连接已断开。 Is there a way to extend the duration of the connection? 有没有办法延长连接时间? Thanks 谢谢

I think it's not a problem with mysqli , but you can look for max_execution_time in your php.ini file and change it to a suitable value. 我认为mysqli并不是问题,但是您可以在php.ini文件中max_execution_time并将其更改为合适的值。 Here you can read more about this. 在这里您可以阅读更多有关此的内容。

But it's better to check your server log to get more insight of your problem. 但是最好检查您的服务器日志以更深入地了解您的问题。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM