1

curl を使用して 1 ページのコンテンツを取得し、静的な html ファイルとして保存したい、環境: Yaf+PHP5.3+nginx;

コードを実行すると、nginx がクラッシュした数秒後に、ページの読み込みが停止しました。

以下のtest1コントローラーコード:

class Test1Controller extends AbstractController
{
    public function indexAction() {
        $ch = curl_init('http://www.alitui.com:8010/test2');
        curl_setopt(CURLOPT_RETURNTRANSFER,true);
        $content = curl_exec($ch);
        curl_close($ch);
        var_dump($content);exit;
    }
}

以下のtest2コントローラーコード:

class Test2Controller extends AbstractController
{
    public function indexAction() {
        echo 1;exit;
    }
}
4

0 に答える 0