php - set_time_limit() 是全局的还是只针对当前运行的脚本?

标签 php timeout

我有一个非常难看的页面,目前我不得不在 PHP 中将最大超时设置为 2 分钟。我正在使用 set_time_limit() 函数,但是来自 official documentation我不清楚“设置”的全局性。

这个宣传语似乎暗示它仅限于特定的脚本:

The set_time_limit() function and the configuration directive max_execution_time only affect the execution time of the script itself. Any time spent on activity that happens outside the execution of the script such as system calls using system(), stream operations, database queries, etc. is not included when determining the maximum time that the script has been running. This is not true on Windows where the measured time is real.

基本上我想仔细检查一下,在一个脚本中设置这个一次性不会影响任何其他脚本的最大运行时间,是吗?运行任何其他页面仍然会有默认超时?没有其他页面(实际上没有其他功能)需要此超时。

最佳答案

仅针对当前正在运行的脚本。

关于php - set_time_limit() 是全局的还是只针对当前运行的脚本?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10398969/

相关文章:

php - 如何使用 PHP 在 FTP 周围复制文件

api - 来自 k8s 主节点的集群 IP 的连接受损/延迟

python-3.x - 捕获套接字超时错误

session - 无论 setMaxIdleTimeout 的值如何,Java WebSocket session 都会超时

Java:如果集合元素在特定超时时间内不活动,则删除它们

php - 如何将变体库存状态添加到 Woocommerce 产品变体下拉列表

php - 正则表达式替换混合数字+字符串

php - 条件 CSS 停止加载内容

php - <select> 的值不在 <options> 中

asp.net - 在ASP.NET内容页面上设置ScriptManager AsyncPostBackTimeout值