Wordpress 插件无法从 Joomla 网站获取 RSS 提要
Wordpress addon unable to fetch RSS feed from Joomla website
我正在使用 Wordpress (4.8.1) 开发一个新网站。我已经安装了 WP RSS Aggregator 插件 (4.11.2) 以从 Joomla (2.5.17) 上先前存在的网站获取 RSS 提要。
Wordpress 安装在 GNU/Linux Debian Stretch (9.1) OS 上,由 Apache (2.4.25) 服务器以 https 提供。 Joomla 在 Squeeze (6.0.10) 和 Apache (2.2.16) 上;该网站以 https 提供,但它似乎不适用于 RSS 提要(URL 在 https 中,但浏览器告诉连接不安全)。
这是 Apache 配置的片段:
<VirtualHost *:80>
ServerName intranet.cdg44.fr
ServerAlias i2.cdg44.fr
Redirect permanent / https://intranet.cdg44.fr/
</VirtualHost>
<VirtualHost *:443>
ServerName intranet.cdg44.fr
SSLEngine On
SSLCertificateFile /etc/ssl/certs/cdg44.pem
SSLCertificateKeyFile /etc/ssl/private/ca.key
<Directory />
Options FollowSymLinks
AllowOverride None
AuthType Kerberos
AuthName "Kerberos Login"
KrbMethodNegotiate On
KrbMethodK5Passwd On
KrbAuthRealms CDG44.FR
Krb5KeyTab /etc/krb5.keytab
require valid-user
</Directory>
</VirtualHost>
(对于这两个网站,我使用 Negociate 进行身份验证)。
WP RSS 聚合器插件告诉我:
Failed to fetch the RSS feed. Error: cURL error 60: SSL certificate problem: unable to get local issuer certificate
我该怎么做才能解决我的问题?
编辑:
尝试以编程方式获取 RSS 提要:
$ch = curl_init();
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);
file_get_contents("https://address.website.com/index.php?option=com_content&view=category&id=27&Itemid=241&format=feed&type=rss");
给出这个错误(由 xdebug):
Warning: file_get_contents(): SSL operation failed with code 1. OpenSSL Error messages: error:14090086:SSL routines:SSL3_GET_SERVER_CERTIFICATE:certificate verify failed in /home/pyledevehat/workspace/intranet/wp-content/themes/themename/functions.php on line 197
我的php.ini配置好:
allow_url_fopen = On
我用这段代码解决了我的问题:
$url = "https://address.website.com/index.php?option=com_content&view=category&id=27&Itemid=241&format=feed&type=rss";
$ch = curl_init();
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_HEADER, false);
$content = curl_exec($ch);
curl_close($ch);
我正在使用 Wordpress (4.8.1) 开发一个新网站。我已经安装了 WP RSS Aggregator 插件 (4.11.2) 以从 Joomla (2.5.17) 上先前存在的网站获取 RSS 提要。 Wordpress 安装在 GNU/Linux Debian Stretch (9.1) OS 上,由 Apache (2.4.25) 服务器以 https 提供。 Joomla 在 Squeeze (6.0.10) 和 Apache (2.2.16) 上;该网站以 https 提供,但它似乎不适用于 RSS 提要(URL 在 https 中,但浏览器告诉连接不安全)。 这是 Apache 配置的片段:
<VirtualHost *:80>
ServerName intranet.cdg44.fr
ServerAlias i2.cdg44.fr
Redirect permanent / https://intranet.cdg44.fr/
</VirtualHost>
<VirtualHost *:443>
ServerName intranet.cdg44.fr
SSLEngine On
SSLCertificateFile /etc/ssl/certs/cdg44.pem
SSLCertificateKeyFile /etc/ssl/private/ca.key
<Directory />
Options FollowSymLinks
AllowOverride None
AuthType Kerberos
AuthName "Kerberos Login"
KrbMethodNegotiate On
KrbMethodK5Passwd On
KrbAuthRealms CDG44.FR
Krb5KeyTab /etc/krb5.keytab
require valid-user
</Directory>
</VirtualHost>
(对于这两个网站,我使用 Negociate 进行身份验证)。
WP RSS 聚合器插件告诉我:
Failed to fetch the RSS feed. Error: cURL error 60: SSL certificate problem: unable to get local issuer certificate
我该怎么做才能解决我的问题?
编辑:
尝试以编程方式获取 RSS 提要:
$ch = curl_init();
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);
file_get_contents("https://address.website.com/index.php?option=com_content&view=category&id=27&Itemid=241&format=feed&type=rss");
给出这个错误(由 xdebug):
Warning: file_get_contents(): SSL operation failed with code 1. OpenSSL Error messages: error:14090086:SSL routines:SSL3_GET_SERVER_CERTIFICATE:certificate verify failed in /home/pyledevehat/workspace/intranet/wp-content/themes/themename/functions.php on line 197
我的php.ini配置好:
allow_url_fopen = On
我用这段代码解决了我的问题:
$url = "https://address.website.com/index.php?option=com_content&view=category&id=27&Itemid=241&format=feed&type=rss";
$ch = curl_init();
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_HEADER, false);
$content = curl_exec($ch);
curl_close($ch);