我想创建一个php脚本,以复制每个页面加载大量的图像。
例如:
image.php
<php
// my url array will be a lot of image path from another websites
// like this: $url[] = 'http://domain.com/image/firstnews.jpg';
$url = array();
for($count = 0; $count < count($url); $count++)
{
if(copy($url[$count], 'temp/' . $newpath))
{
// make_thumb() is a function that i have created it
if(make_thumb($newpath , $thumb))
{
unlink('temp/' . $newpath);
}
}
}
?>如果我的图像计数是8-10,这是很好的,并且工作成功,但如果图像计数是更好的,例如,图像计数是12,它不能工作,我有一些错误:
有时: 503服务从服务器不可用
有时: php超时60秒。
我想问题出在copy(),但我不知道为什么?
请帮帮我。我不是专业的程序员。
发布于 2014-06-04 19:03:57
ini_set('max_execution_time', 0);在执行复制操作之前使用此行。
https://stackoverflow.com/questions/24035682
复制相似问题