Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/php/234.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Php tmhOAuth不';I don’我从来没有归还过任何东西,如此困惑_Php_Twitter - Fatal编程技术网

Php tmhOAuth不';I don’我从来没有归还过任何东西,如此困惑

Php tmhOAuth不';I don’我从来没有归还过任何东西,如此困惑,php,twitter,Php,Twitter,即使下面最基本的代码也不会返回任何内容,从GitHub运行最新版本的tmhOAuth和tmhUtilities,运行它(使用从Twitter开发站点中我的应用程序复制的有效密钥和机密-出于安全目的,它们在此处被隐藏) 页面根本没有输出任何内容,没有任何内容。。。这么困惑?此脚本是否存在CSF/cPanel的防火墙问题?我试着从服务器上以root用户身份ping api.twitter.com,效果很好 真的在为想法奋斗吗?因为它以前工作过,下一分钟什么也没发生 $code的var_转储返回空值:

即使下面最基本的代码也不会返回任何内容,从GitHub运行最新版本的tmhOAuth和tmhUtilities,运行它(使用从Twitter开发站点中我的应用程序复制的有效密钥和机密-出于安全目的,它们在此处被隐藏)

页面根本没有输出任何内容,没有任何内容。。。这么困惑?此脚本是否存在CSF/cPanel的防火墙问题?我试着从服务器上以root用户身份ping api.twitter.com,效果很好

真的在为想法奋斗吗?因为它以前工作过,下一分钟什么也没发生

$code的var_转储返回空值:/

<?php
require 'tmhOAuth.php';
require 'tmhUtilities.php';
$tmhOAuth = new tmhOAuth(array(
  'consumer_key'    => '********',
  'consumer_secret' => '****************',
  'user_token'      => '********',
  'user_secret'     => '****************'
));

$code = $tmhOAuth->request('GET', $tmhOAuth->url('1/account/verify_credentials'));

if ($code == 200) {
  echo 'The access level of this token is: ' . $tmhOAuth->response['headers']['x_access_level'] . PHP_EOL;
  tmhUtilities::pr($tmhOAuth->response);
} else {
    tmhUtilities::pr(htmlentities($tmhOAuth->response['response']));
}

再次从GitHub更新了tmhOAuth库,并确保cacert.pem位于tmhOAuth的同一目录中(最终修复了它:)

object(tmhOAuth)#1 (3) { ["params"]=> array(0) { } ["auto_fixed_time"]=> bool(false) ["config"]=> array(19) { ["consumer_key"]=> string(22) "**********" ["consumer_secret"]=> string(42) "*********" ["user_token"]=> string(50) "********" ["user_secret"]=> string(43) "************" ["use_ssl"]=> bool(true) ["host"]=> string(15) "api.twitter.com" ["debug"]=> bool(true) ["force_nonce"]=> bool(false) ["nonce"]=> bool(false) ["force_timestamp"]=> bool(false) ["timestamp"]=> bool(false) ["oauth_version"]=> string(3) "1.0" ["curl_connecttimeout"]=> int(30) ["curl_timeout"]=> int(10) ["curl_ssl_verifypeer"]=> bool(false) ["curl_followlocation"]=> bool(false) ["is_streaming"]=> bool(false) ["streaming_eol"]=> string(2) " " ["streaming_metrics_interval"]=> int(60) } }