使脚本执行不受限制 [英] make script execution to unlimited

查看:72
本文介绍了使脚本执行不受限制的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要将脚本运行到localhost(xampp)中,它将生成14400条记录并将其添加到数据库中,我已经设置了max_execution_time = 50000000000,我不知道是否可以通过将其设置为0或-1来使其不受限制.但是我之前尝试过使用此脚本,将max_execution_time设置为50000000000,但它在某些时候停止了,我不知道还有什么可以限制执行时间,我已经运行了很多次了,所以我厌倦了再次等待并失败了,什么我应该在再次运行此脚本之前更改一次,这次是完成工作吗?

I need to run a script into localhost (xampp) which will generate 14400 records and adds them into database, I have set the max_execution_time = 50000000000, I dont know if I can make it unlimited by setting it to 0 or -1. But I tried this script before with this max_execution_time to 50000000000 and yet it stoped at certain point, I dont know what else could limit the execution time, I have been running this a lot of times and I am tired of waiting and failing again, what should I change before I run this script again and this time to finish the job?

推荐答案

您必须将其设置为零.零表示脚本可以永远运行.在脚本的开头添加以下内容:

You'll have to set it to zero. Zero means the script can run forever. Add the following at the start of your script:

ini_set('max_execution_time', 0);

请参阅 max_execution_time 的PHP文档.

Refer to the PHP documentation of max_execution_time

请注意:

set_time_limit(0);

将具有相同的效果.

这篇关于使脚本执行不受限制的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆