V
V
v7resspect2017-08-22 17:38:05
PHP
v7resspect, 2017-08-22 17:38:05

Why can't setProxy work in codebird via cron?

If you open the page in the browser, all the code works flawlessly, the tweet is sent to twitter. If you run this script through cron, it slows down on the setProxy function. Here is the code:

use Codebird\Codebird;

require_once ROOT.'/work/class/codebird/codebird.php';

$cb = new Codebird;

$twitter = $db->super_query("SELECT * FROM twitters WHERE id='15'");

$cb->setConsumerKey($twitter['key'], $twitter['key_secret']);
$cb->setToken($twitter['token'], $twitter['token_secret']);
$cb->setProxy($twitter['ip'], $twitter['port']);		// на этой функции постинг тормозит
$cb->setProxyAuthentication($twitter['login'].':'.$twitter['password']);

$reply = $cb->media_upload(array(
'media' => $image
));

$params = array(
'status' => $status,
'media_ids' => $reply->media_id_string
);

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
Stanislav B, 2017-08-22
@v7resspect

Probably the difference in the php settings for fpm (or whatever you have) and cli.
Perhaps for your cli, the curl extension is not connected.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question