I have no clue why... But all the methods I listed in the title are slow. They take about 10 seconds, yet when I visit the sites, they load immediately. Here is one of my codes that uses file_get_conents:
<?php
$search = $_GET['search'];
$postdata = http_build_query(
array(
'searchnode' => '' . $search . ''
)
);
$opts = array('http' =>
array(
'method' => 'POST',
'header' => 'Connection: close',
'content' => $postdata
)
);
$context = stream_context_create($opts);
$result = file_get_contents('http://google.com', false, $context);
echo $result;
?>
This code is just an example of what I use. But even using this code, it loads slow. I am using "Connection: close" also. Is this possibly a problem with the PHP config, or something else? I am using CentOS with cPanel + WHM. I do have shell and root access.