Recent Topics

1 Oct 22, 2019 22:52    

Editor gets error on webmention_plugin when trying to save article or amendment

Sorry, I have to guess the URL so it may not be exact. However, he did have the good sense to take a screenshot and send it to me, and I have uploaded it. He tells me the new data is saved but that it is a very slow process.

The screenshot says:

Fatal Error: Uncaught Error: Call to undefined function IndieWeb\curl_init() in /srv/hereticus-economicus.info/public/htdocs/plugins/webmention_plugin/MentionClient.php on line 461.

This is the section of code in question - PHP is notorious for sending out false error messages so I'm not going to assume it's the actual line 461:
/**
* @param $url
* @param $body
* @param array $headers
* @return array
* @codeCoverageIgnore
*/
protected static function _post($url, $body, $headers=array()) {
if(self::$_userAgent)
$headers[] = 'User-Agent: '.self::$_userAgent;

$ch = curl_init($url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, $body);
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
curl_setopt($ch, CURLOPT_HEADER, true);
if (self::$_proxy) curl_setopt($ch, CURLOPT_PROXY, self::$_proxy);
$response = curl_exec($ch);
self::_debug($response);
$header_size = curl_getinfo($ch, CURLINFO_HEADER_SIZE);
return array(
'code' => curl_getinfo($ch, CURLINFO_HTTP_CODE),
'headers' => self::_parse_headers(trim(substr($response, 0, $header_size)$
'body' => substr($response, $header_size)
);
}

That appears on the face of it to be looking for curl, which is not installed. But so far as I remember there's no mention of curl dependency in the docs. Had there been I would have installed it. It's in a PHP file, so I'm assuming module php-curl, which is installed and functioning. Which of curl and php-curl is actually correct and why is whichever it is misbehaving?


Form is loading...

Multiple blogs solution – This forum is powered by b2evolution CMS, a complete engine for your website.