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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T19:50:23+00:00 2026-06-05T19:50:23+00:00

I just started with facebook app development. Problem is that require statement is not

  • 0

I just started with facebook app development.

Problem is that require statement is not working.Even i tried 2 different simple php scripts with include & require statements,It is not locally on wamp server correctly but not as facebook app.

What should i do to get this done??
Code:

<?php
require 'facebook-php-sdk/src/facebook.php';

$facebook = new Facebook(array(
'appId'  => 'YOUR_APP_ID',
'secret' => 'YOUR_APP_SECRET',
));

// Get User ID
$user = $facebook->getUser();
echo "your id id".$user;
?>

It is only printing your id is.Even facebook.php and other files are at right place.

  • 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-05T19:50:25+00:00Added an answer on June 5, 2026 at 7:50 pm

    require throws an error if the file can not be found/accessed. If you don’t see anything like that, first make sure you’ve set up error_reporting and display_errors in your PHP development environment right. If still no messages appear, than there is no real problem with embedding the SDK; more likely getUser just returns null or false, and so you just don’t see anything when echo-ing it. Please use var_dump in cases like this, it’ll tell you exactly what type and value a variable really has.

    These are absolute basics of PHP debugging – please get a little more used to this, maybe work through some tutorials on the matter, before continuing developing PHP apps for Facebook.

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

Sidebar

Related Questions

Just getting started building an app using the v6 of the facebook c# sdk
Just started working with .NET and MVC(1). I'm having a problem wherein in my
Basically, I've just started some development on getting a Facebook Open Graph action for
Since I have just started working with Facebook's api I had a few questions
Asking on behalf of my coworker: We're working on a Facebook app that uses
I've just started using the facebook-ios-SDK. I'm trying to run the sample app to
I'm using Devise and OmniAuth (Facebook) in a Rails 3 app. I just started
I am a novice in Facebook development and PHP. I just started today and
Just started tinkering with Dart and I decided to write a simple Http Server
I am just getting started with the Facebook JavaScript SDK, all I want to

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.