dimanche 29 mars 2015

Wordpress xmlprc not working in https

Recently, I have updated my site using an SSL and all URIs are now "https://".


My site is developed with Symfony 2 and mixing a Wordpress installation inside Symfony 2 web/wordpress directory.


All regular access is fine. Only one question:


In my Symfony 2, there is this code snippet:



private function getRecentPosts($num = 4)
{
require_once 'wordpress/wp-includes/class-IXR.php';

$user = '11111';
$pwd = '22222';

$host='https://www.rsywx.net';
$script='/wordpress/xmlrpc.php';
$port=443;

$client = new \IXR_Client($host, $script, $port);

$params = array(0, $user, $pwd, $num);
$client->query('metaWeblog.getRecentPosts', $params);

$wp = $client->getResponse();

return $wp;
}


When my site is not wrapped with https, the above code works fine. But now it is under https, the above code is not working. If I dump the $client variable after the query function call, it gives an error like:



+error: IXR_Error {#256 ▼
+code: -32300
+message: "transport error - could not open socket"


Any hints? Do I need to tweak my WP?


Aucun commentaire:

Enregistrer un commentaire