$ch = curl_init('https://drive.google.com/uc?export=download&id=DRIVE_FILE_ID');
$fp = fopen('/your_puth/filename.jpg', 'wb');
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);
curl_setopt($ch, CURLOPT_FILE, $fp);
curl_setopt($ch, CURLOPT_HEADER, 0);
curl_exec($ch);
curl_close($ch);
fclose($fp);