PHP忽略我的max_execution_time [英] PHP Ignoring my max_execution_time
问题描述
我的脚本中有一些任务,涉及使用ffmpeg转换视频.我使用codeigniter 2.0.3进行此操作,并将脚本放在库中,然后使用shell_exec()运行ffmpeg.
I have some task in my script that is about converting video with ffmpeg . I do this with codeigniter 2.0.3 and locate the script at libraries and use shell_exec() to run ffmpeg.
我的php脚本中有3个任务.
There are 3 tasks in my php script.
- 上传文件
- 将视频转换为.flv
- 产生拇指
- 保存到数据库.
当我上传文件时,我的php脚本开始转换我上传的视频.但是转换结束大约需要5分钟以上.它不会继续产生拇指.它说
When I upload file, my php script start to convert my uploaded video. But when converting is end about over 5 minutes. Its not continue to generate thumb. And Its say
PHP致命错误:在第102行的C:\ AppServ \ www \ mis \ application \ libraries \ my_video_utility.php中,超过300秒的最大执行时间,引用者:我在php.ini中将max_execution time,max_input_time等设置为3600,还在我的php脚本中添加了set_time_limit()和set_ini().但是,它仍然会出错.
I have set my max_execution time, max_input_time, etc to 3600 in php.ini also add set_time_limit() and set_ini() in my php script. But, its still get error.
但是,当我上传短视频时,它就完成了.
But, when I uploaded short video, its done.
推荐答案
好.我自己做.我已经联系了我的老师.某些东西CodeIgniter不在其文档中.
Ok. I do this my self. I have contacted my teacher. There is a something that CodeIgniter not include this in their documentation.
在system/core/CodeIgniter.php中的第103行
At line 103 in system/core/CodeIgniter.php
if (function_exists("set_time_limit") == TRUE AND @ini_get("safe_mode") == 0) { @set_time_limit(300); }
我尝试更改该值,并且它起作用.
I try to change the value and it works.
这篇关于PHP忽略我的max_execution_time的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!