我的Mac电脑上目前已经安装了PHP5.6.10。我尝试从启用了https的网站中使用以下代码提取数据:
<?php
ini_set('display_errors', 1);
ini_set('display_startup_errors', 1);
error_reporting(E_ALL);
$url = "https://deshsanchar.com/feed";
file_put_contents("temp.xml", fopen($url, 'r'));
?>
但是,该页显示以下带有空temp.xml文件的警告:
警告:在第6行的/Applications/MAMP/htdocs/cacert-2019-01-23.pem'中加载cafile流失败
警告:fopen(
https://deshsanchar.com/feed
我已经从下载了cacert-2019-01-23.pem文件
https://curl.haxx.se/docs/caextract.html
extension=php_openssl.dll
allow_url_include = On
curl.cainfo=â¨/â¨Applications/MAMPâ©/â¨htdocsâ©/cacert-2019-01-23.pem
openssl.cafile=â¨/â¨Applications/MAMPâ©/â¨htdocsâ©/cacert-2019-01-23.pem
我重新启动了MAMP服务器,但它没有按预期工作。