curl_setopt($ch, CURLOPT_FOLLOWLOCATION , 1);

satırını

#curl_setopt($ch, CURLOPT_FOLLOWLOCATION , 1);

ile değiştirin.