php copy (a file) is only working some of the time?

佐手、 提交于 2021-02-11 18:22:39

问题


I wrote a script that copies files into another directory. And it sometimes works and sometimes doesn't work. It honestly baffles me.

I'm using it to copy image files from one directory to another. Something like this.

$src = "images/" . $filename;
$dest = "temp_dir/" . $filename;

$result = copy($src,$dest);

var_dump($result);

Sometimes it works, and sometimes it just doesn't copy, even though the result always always always says TRUE. It seems that after I copy, it stops working for a few minute then will work again, then stop again for a few minutes.

Is this a problem with memory being tied up? Or is a stream being opened that I need to close? Or something weird like this?

Please help.

来源:https://stackoverflow.com/questions/22418849/php-copy-a-file-is-only-working-some-of-the-time

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!