monitorbacklinks / yii2-wordpress

Yii2 component for integration with Wordpress CMS via XML-RPC API
http://monitorbacklinks.github.io/yii2-wordpress/
MIT License
33 stars 11 forks source link

Problem with xmlrpc_encode_request #1

Open disvroian opened 9 years ago

disvroian commented 9 years ago

Hello After installing your extension i have the following error : Call to undefined function HieuLe\WordpressXmlrpcClient\xmlrpc_encode_request() at line 823 if (!$this->_endPoint) { echo $this->_endPoint;exit();

        $this->_error = "Invalid endpoint " . json_encode(array('endpoint' => $this->_endPoint, 'username' => $this->_username, 'password' => $this->_password));
        $this->_logError();
        throw new \Exception($this->_error);
    }
    $this->_responseHeader = array();
    $this->_setXmlrpcType($params);
    $this->_request        = xmlrpc_encode_request($method, $params, array('encoding' => 'UTF-8', 'escaping' => 'markup'));
    $body                  = "";
    // Call sending event callbacks
    $callbacks = $this->_getCallback('sending');

Also when you look at php they do not recommend to use as it s still experimental. Do you have any tips to solve ? I use mamp php version 5.5.10 with apache i tried to install /Applications/MAMP/bin/php/php5.5.10/bin/pear install XML_RPC successfully but still get my error.

arm4b commented 9 years ago

Can you double check if XMLRPC php extension is loaded?

Create file info.php and run it in your browser:

<?php
echo 'XMLRPC is ', extension_loaded('xmlrpc') ? 'loaded' : 'not loaded';

Without xmlrpc extension is not possible to run this plugin, since it's used to communicate between Wordpress and Yii2.

yii2-wordpress is wrapper for https://github.com/letrunghieu/wordpress-xmlrpc-client which requires xmlrpc php extension.

arm4b commented 9 years ago

So if it's not loaded, maybe check this discussion: http://stackoverflow.com/questions/2031564/php-xmlrpc-extension-and-mamp

Also if XMLRPC is installed by pear and still not loaded, all you may need is to add

extension=xmlrpc.so

to your php.ini and restart mamp.

ghost commented 9 years ago

Hi, After installing extension im getting following error, and as per ur suggestion I have cross checked that XMLRPC is loaded in my localhost. How to use this please explain asap.

PHP Fatal Error – yii\base\ErrorException

Class 'HieuLe\WordpressXmlrpcClient\WordpressClient' not found

  1. in D:\xampp\htdocs\yii2\vendor\monitorbacklinks\yii2-wordpress\Wordpress.php at line 207 198199200201202203204205206207208209210211212213214215216 } if (!is_array($this->proxyConfig)) { throw new InvalidConfigException("Class \"{$className}\" requires \"\$proxyConfig\" to be given in array format."); } if (!is_array($this->httpAuthConfig)) { throw new InvalidConfigException("Class \"{$className}\" requires \"\$httpAuthConfig\" to be given in array format."); }
    // Create API client
    $this->_clientInstance = new WordpressClient($this->endpoint, $this->username, $this->password);
    $this->_clientInstance->setProxy($this->proxyConfig);
    $this->_clientInstance->setAuth($this->httpAuthConfig