I have a few questions that I have been searching answers for.
1: Php memory allocation.
If I have a 1 megabyte variable $img =file_get_contents('imageUrl');
and my php memory allocation is 64 megabytes, and 100 people are accessing the script at the same time, Is that going to cause a memory allocation error?
2: How would I better save an image from a url? I am getting a memory allocation warning...
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