Home » Php » Request Timeout: 500 Internal server error

Request Timeout: 500 Internal server error

Posted by: admin June 30, 2018 Leave a comment

Questions:

I am using this php script for downloading files from URL.

<?php
set_time_limit(10);

$url  = "http://speedtest.tele2.net/10GB.zip";
$path = "10GB.zip";

$fp = fopen($path, 'w');

$ch = curl_init($url);
curl_setopt($ch, CURLOPT_FILE, $fp);

$data = curl_exec($ch);

curl_close($ch);
fclose($fp);
echo "File Downloaded!";
?>

But i am getting Request timeout error. so I edited this files .htaccess, .user.ini, .php.ini with this code:

  <IfModule php5_module>
     php_flag asp_tags Off
     php_flag display_errors Off
     php_value max_execution_time 3600
     php_value max_input_time 60
     php_value max_input_vars 1000
     php_value memory_limit 32M
     php_value post_max_size 8M
     php_value session.gc_maxlifetime 1440
     php_value session.save_path "/var/cpanel/php/sessions/ea-php56"
     php_value upload_max_filesize 2M
     php_flag zlib.output_compression Off
    </IfModule>

But I still getting this error. Why this is happening?

Answers: