I want to use curl to get one page content and save as static html file, environment: Yaf+PHP5.3+nginx;
When I run the code, page was stucked loading, after several seconds nginx crashed.
test1 Controller code below:
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;
}
}
and test2 controller code below:
class Test2Controller extends AbstractController
{
public function indexAction() {
echo 1;exit;
}
}