Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8143023
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T12:59:02+00:00 2026-06-06T12:59:02+00:00

i am using hybridauth to get userinformation from social web sites like facebook,twitter, etc.

  • 0

i am using hybridauth to get userinformation from social web sites like facebook,twitter, etc.PHP lib to connect
i configured using install.php which is available in the hybridauth folder itself.

when i tried to use some examples available in my own application i get the following error

Hybriauth configuration error.

Original error message: Hybriauth config does not exist on the given path.

here is my full code:(index.php)

<?php
    // start a new session (required for Hybridauth)
    session_start();

    // change the following paths if necessary

    //require_once( str_replace('//','/',dirname(__FILE__).'/') .'folder/sub.php'); 

    $config = dirname(__FILE__).'hybridauth/config.php';
    require_once( "hybridauth/Hybrid/Auth.php" );
    try{
    // create an instance for Hybridauth with the configuration file path as parameter
    $hybridauth = new Hybrid_Auth( $config );
    // try to authenticate the user with twitter,
    // user will be redirected to Twitter for authentication,
    // if he already did, then Hybridauth will ignore this step and return an instance of the adapter
    $twitter = $hybridauth->authenticate( "Twitter" );

    // get the user profile
    $twitter_user_profile = $twitter->getUserProfile();
    echo "Ohai there! U are connected with: <b>{$twitter->id}</b><br />";
    echo "As: <b>{$twitter_user_profile->displayName}</b><br />";
    echo "And your provider user identifier is: <b>{$twitter_user_profile->identifier}</b><br />";

    // debug the user profile
    print_r( $twitter_user_profile );

    // exp of using the twitter social api: return users count of friends, followers, updates etc.
    $account_totals = $twitter->api()->get( 'account/totals.json' );

    // print recived stats
    echo "Here some of yours stats on twitter: " . print_r( $account_totals, true );

    // disconnect the user ONLY form twitter
    // this will not disconnect the user from others providers if any used nor from your application
    echo "Logging out..";
    $twitter->logout();
    }
    catch( Exception $e ){
    // Display the recived error,
    // to know more please refer to Exceptions handling section on the userguide
    switch( $e->getCode() ){
    case 0 : echo "Unspecified error."; break;
    case 1 : echo "Hybriauth configuration error."; break;
    case 2 : echo "Provider not properly configured."; break;
    case 3 : echo "Unknown or disabled provider."; break;
    case 4 : echo "Missing provider application credentials."; break;
    case 5 : echo "Authentification failed. "
    . "The user has canceled the authentication or the provider refused the connection.";
    break;
    case 6 : echo "User profile request failed. Most likely the user is not connected "
    . "to the provider and he should authenticate again.";
    $twitter->logout();
    break;
    case 7 : echo "User not connected to the provider.";
    $twitter->logout();
    break;
    case 8 : echo "Provider does not support this feature."; break;
    }

    // well, basically your should not display this to the end user, just give him a hint and move on..
    echo "<br /><br /><b>Original error message:</b> " . $e->getMessage();
    }

my folder structure is as follows :

project folder : 
 slingshare
   --hybridauth
       -- Hybrid
            --Auth.php
   --config.php
index.php

since i am very new guy to this PHP i am unable to find it out please do help me to find this.

Regards
Tony

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-06T12:59:04+00:00Added an answer on June 6, 2026 at 12:59 pm

    dirname will give you something like /my/website/scripts without the ending slash.

    so you need to change your code to:

    $config = dirname(__FILE__).'/hybridauth/config.php';
    

    An aside, consider using absolute paths for your require()s and include()s

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

i am using hybridauth to get userinformation from social web sites like facebook,twitter, etc.
I am trying to connect with social web sites like facebook,twitter,linkedin etc using Hybridauth
Using php/html, I want to retrieve email addresses (plus other information) from MySQL and
I am connecting to the Facebook API using HybridAuth on the server side (backend
Using the http://www.ifans.com/forums/showthread.php?t=132024 post from another question i am allowing the user to enter
Using the C# Facebook SDK 5.0.3 everything works fine whit the client.Get(/me). But when
Using Java, how can I extract all the links from a given web page?
Using the Redis info command, I am able to get all the stats of
Using Location.getBearing(); I seem to get randomly changing bearings. Aka, I can turn the
Using Rails 3.2.0 with haml and sass: I Would like to link an external

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.