PHP file_get_contents very slow when using full url

后端 未结 9 1048
我在风中等你
我在风中等你 2020-11-27 12:10

I am working with a script (that I did not create originally) that generates a pdf file from an HTML page. The problem is that it is now taking a very long time, like 1-2 mi

9条回答
  •  执笔经年
    2020-11-27 12:40

    I had the same issue,

    The only thing that worked for me is setting timeout in $options array.

    $options = array(
        'http' => array(
            'header'  => implode($headers, "\r\n"),
            'method'  => 'POST',
            'content' => '',
            'timeout' => .5
        ),
    );
    

提交回复
热议问题