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 8006401
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T17:30:13+00:00 2026-06-04T17:30:13+00:00

I am using the FB PHP SDK to post a message to a user’s

  • 0

I am using the FB PHP SDK to post a message to a user’s wall.
Once the user is authenticated via FB I allow them to post a message using this helper function

function post_facebook($fb) {

    $CI =& get_instance();

    $CI->load->library('facebook');

    $config = array(
        'appId'  => '123123123123',
        'secret' => '567567567567'
    );

    $facebook = new Facebook($config);
    $user_id  = $facebook->getUser();

    if ($user_id) {

        $facebook->api('/me/feed', 'POST', array(
                                              'message' => $fb['post_text'],
                                           )
                   );
     }
}

This actually sends the post to FB and it shows on the wall.

But in Firebug I can see this error

<h4>A PHP Error was encountered</h4>

<p>Severity: Warning</p>
<p>Message:  Missing argument 1 for Facebook::__construct(), called in /var/www/vhosts/example.com/httpdocs/system/core/Loader.php on line 1099 and defined</p>
<p>Filename: libraries/Facebook.php</p>
<p>Line Number: 36</p>

</div><div style="border:1px solid #990000;padding-left:20px;margin:0 0 10px 0;">

<h4>A PHP Error was encountered</h4>

<p>Severity: Notice</p>
<p>Message:  Undefined variable: config</p>
<p>Filename: libraries/Facebook.php</p>
<p>Line Number: 40</p>

</div>

Any idea what I’m doing wrong?

  • 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-04T17:30:15+00:00Added an answer on June 4, 2026 at 5:30 pm

    The error you see is from the call to $this->load->library('facebook'), you should pass the $config array as a parameter to it and access the library from the CI object, like this:

    $config = array(
        'appId'  => '123123123123',
        'secret' => '567567567567'
    );
    $CI->load->library('facebook', $config);
    
    $user_id  = $CI->facebook->getUser();
    

    Read more about the loader here:

    http://codeigniter.com/user_guide/libraries/loader.html

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

Sidebar

Related Questions

I would like to post to my user's wall using php sdk and the
I'd like to use the Facebook PHP SDK to post on a user's wall
I am trying to post on my friend's wall using PHP SDK of FB.
I'm trying to do the following using FB's official PHP SDK: $facebook->api( '/me/feed', 'POST',
Trying to post a status update using facebook php sdk. Code posted below. As
so I'm using the Facebook PHP SDK for authenticating my user.... and I'm trying
As of this writing, I'm using PHP SDK v3.1.1-12, and I used the same
I am integration Facebook connect in my website using php SDK.. Everything is working
Using the PHP sdk I'm signing users into my site with Facebook log in.
I'm using the Facebook PHP-SDK to sign in users and it works fine. I'm

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.