プロキシ経由でfile_get_contents - Road To Nowhere
kazumaryu.hatenablog.com
結論から言うと、プロキシ経由でアクセスするためにプロキシ設定をしなければなりませんでした。
以下ソース
<?php
$proxy = array(
"http" => array(
"proxy" => "tcp://サーバー名:ポート番号",
'request_fulluri' => true,
),
);
$proxy_context = stream_context_create($proxy);
echo file_get_contents("http://www.google.co.jp/?gws_rd=ssl",false,$proxy_context);
?>