在每个图像上订购任务。
- check image exist
- create thumbnail
- save information of images and thumb to database如果我们使用更多的图像来执行请求,并且需要比php的默认设置(30s)更多的时间来执行请求
时间是否包含php执行时间+ mysql时间?还是只有php的时间?
当我保存信息时,一些图像仍然插入到数据库时丢失了信息
示例: 30张图片
php : scan information of 25 images
mysql: insert 30 images infor我认为php处理时间超过了默认时间,请求将被停止。所以mysql只在infor中插入了25张图片。是这样吗?
$infor
if (// create thumb and get infor successfull) // if exceed time , why script don't stop inserting infor
{
$infor return information of images
}
$database->insert($infor)我想知道的是脚本什么时候会停止。如果进程是创建thumb步骤且超时停止,为什么脚本继续向数据库插入null infor
发布于 2011-07-14 10:39:04
您可以在.ini文件或代码中增加时间,如下所示
ini_set('max_execution_time', 300); //300 seconds = 5 minutes或者在PHP上使用set_time_limit函数。
发布于 2011-07-14 10:45:20
在这种情况下,使用
set_time_limit(0);0表示无限制。在你的php文件上使用这个函数可能需要很长时间。
https://stackoverflow.com/questions/6687744
复制相似问题