【发布时间】:2012-12-14 05:32:16
【问题描述】:
我正在建立一个个人股票平台(未分发)。我想要的一个组件是此页面上的 EPS 图:
如您所见,该页面是https,所以经过几天的努力,我启用了openssl,现在它似乎适用于所有https 页面,例如facebook 和twitter 的主页,但是它仍然无法满足我的需要。
file_get_contents('https://facebook.com'); /* works */
file_get_contents('https://twittercom'); /* works */
file_get_contents('https://eresearch.fidelity.com/eresearch/evaluate/fundamentals/earnings.jhtml?stockspage=earnings&symbols=AAPL&showPriceLine=yes');
我收到警告:
Warning: file_get_contents(): SSL: crypto enabling timeout in C:\xampp\htdocs\index.php on line 3
Warning: file_get_contents(): Failed to enable crypto in C:\xampp\htdocs\index.php on line 3
Warning: file_get_contents(https://eresearch.fidelity.com/eresearch/evaluate/fundamentals/earnings.jhtml?stockspage=earnings&symbols=AAPL&showPriceLine=yes): failed to open stream: operation failed in C:\xampp\htdocs\index.php on line 3
Fatal error: Maximum execution time of 30 seconds exceeded in C:\xampp\htdocs\index.php on line 3
我能看到的唯一区别是保真度页面在 https 标签附近有一个三角形。
【问题讨论】:
-
@Stony 我已经测试了所有的 stackoverflow 答案。对于您提供的链接,第一个答案是:
openssl: yes http wrapper: yes https wrapper: yes从 phpinfo() 打开或启用所有 SSL 选项。第二个答案:extension=php_openssl.dll和allow_url_include = On在php.ini中启用。 -
非常有趣,我试过了,但 30 秒后我超时了。目标站点有问题。也许你尝试一个 curl 请求。
-
嗯...那我得弄清楚如何配置 CURL。
-
OK 与 CURL 相同的问题。也许创建该站点的人已经更改了您无法从该站点获取数据的内容。也许它的目的。也许该网站有 API?