答えを探している質問がいくつかあります。
1: PHP メモリ割り当て。
1メガバイトの変数がある場合$img =file_get_contents('imageUrl');
私のphpメモリ割り当ては64メガバイトで、100人が同時にスクリプトにアクセスしています。メモリ割り当てエラーが発生しますか?
2: URL から画像を保存するにはどうすればよいですか? メモリ割り当ての警告が表示されます...
if ($fileName){
//check to make sure filename is not taken
if(!file_exists("img/".$fileName.$fileExt)){
$image = file_get_contents("someURL".$fileName.$fileExt);
//check to make sure the filesize is not rediculous 8 Megabytes.
if(strlen($image) < (8 * 1048576)){
if(file_put_contents("img/".$fileName.$fileExt, $image)){
usleep((0.25 * 1000000)); //rest 1/4 second
if(!image_resize("img/".$fileName.$fileExt, 202, 202, 1))die('no rezize');
//PRETEND THERE ARE CLOSING CURLY BRACES THANKS