使用Simplepie获取Facebook最新帖子

My facebook posts rss is located at this url :

https://www.facebook.com/feeds/page.php?id=my_app_id&format=rss20

And i try to get the data from it using Simplepie on my Laravel project and it seems it's not working. If i change the rss url to another which is not facebook rss type it works perfect.

Here is my code:

$feed_url = 'https://www.facebook.com/feeds/page.php?id=my_app_id&format=rss20';

$feed = new SimplePie();
$feed->set_feed_url($feed_url);
$feed->enable_cache(false);
$feed->set_output_encoding('utf-8');
$feed->init();

print $feed->get_title();

The output is blank page. Any way to fix this?

The problem comes from this error:

cURL error 60: SSL certificate problem: unable to get local issuer certificate

It was because I was using localhost and it seemed that I did not had some curl options set. After I've put it on production it worked like a charm.