Answer the question
In order to leave comments, you need to log in
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
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 questionAsk a Question
731 491 924 answers to any question