I'm trying to upload big file to ftp server with Laravel Storage function and it's keep give me the erorr
Out of memory (allocated 473432064) (tried to allocate 467402752 bytes)
Finally I solve the problem by using curl instead of Storage.
$ch = curl_init(); $localfile = $file->getRealPath(); $fp = fopen($localfile, 'r'); curl_setopt($ch, CURLOPT_URL, 'ftp://domain/' . $fileName); curl_setopt($ch, CURLOPT_USERPWD, "user:pass"); curl_setopt($ch, CURLOPT_UPLOAD, 1); curl_setopt($ch, CURLOPT_INFILE, $fp); curl_setopt($ch, CURLOPT_INFILESIZE, filesize($localfile)); curl_exec($ch); $error_no = curl_errno($ch); curl_close($ch);
Work perfect! Better then Storage option of laravel.