本文介绍了找不到类PHP的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我使用了并收到此错误。谁能告诉我我要去哪里错了吗?
I used THIS twitter librabry and getting this error. Can anyone tell where i am going wrong ?
错误
Fatal error: Class 'Abraham\TwitterOAuth\Config' not found in D:\wamp\www\Abraham\TwitterOAuth\TwitterOAuth.php on line 17
PHP
<?php
require_once("Abraham/TwitterOAuth/TwitterOAuth.php"); //Path to twitteroauth library you downloaded in step 3
//keys and tokens initialised
function getConnectionWithAccessToken($cons_key, $cons_secret, $oauth_token, $oauth_token_secret) {
$connection = new TwitterOAuth($cons_key, $cons_secret, $oauth_token, $oauth_token_secret);
return $connection;
}
$connection = getConnectionWithAccessToken($consumerkey, $consumersecret, $accesstoken, $accesstokensecret);
$tweets = $connection->get("https://api.twitter.com/1.1/statuses/user_timeline.json?screen_name=".$twitteruser."&count=".$notweets);
echo json_encode($tweets);
echo $tweets; //testing remove for production
?>
推荐答案
您确定这是正确的方法吗? :
Are you sure that this is correct way? :
require_once( Abraham / TwitterOAuth / TwitterOAuth.php);
您可以尝试:
require_once("Abraham/autoload.php");
require_once("Abraham/TwitterOAuth/TwitterOAuth.php");
use Abraham\TwitterOAuth\TwitterOAuth;
这篇关于找不到类PHP的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!