I'm trying to download a from into the server from a url, but the file is partially downloaded and I get a server error with no specific errors showing to debug.
The PHP code is as follows.
if (!isset($_GET['url'])){
die('set file url');
}
if (empty($_GET['url'])){
die('file url cannot be empty');
}
error_reporting(E_ALL);
ini_set('display_errors', 1);
set_time_limit(3600000);
$file_url = $_GET['url'];
$ext_array = explode('.', $file_url);
$extention = end($ext_array);
$new_file_name = "file".time().rand().".".$extention."";
file_put_contents($new_file_name, fopen($file_url, 'r'));
As on the code, I tried turning error reporting ON and also made a php.ini on the server but no errors are shown nor logged into an error log file.
Also I'm on shared hosting.
MORE INFO
The file i'm trying to download is about 1.5 Gigs, and only ~125MB is being downloaded before the error.