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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T19:16:36+00:00 2026-06-18T19:16:36+00:00

$url = ‘http://xxxxxx.com:8052/php/myproject/’; $loginUrl = $facebook->getLoginUrl(array( ‘scope’ => ‘publish_stream,email’, ‘redirect_uri’ => $url, )); $facebook->getUser()

  • 0
$url = 'http://xxxxxx.com:8052/php/myproject/';

$loginUrl = $facebook->getLoginUrl(array(
'scope' => 'publish_stream,email',
'redirect_uri' => $url,
));

$facebook->getUser() will have 0.
That is because my server is using port 8052 for http(Sharing IP with other server)

It is not working if I use port number at redirect_uri.

I am sure the domain setting is correct at Facebook.com

How to solve this?

  • 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-18T19:16:37+00:00Added an answer on June 18, 2026 at 7:16 pm

    This is not programming problem, i am using port forward for the tomcat server. 8052->tomcat
    You can’t get correct 8052 port if you are using port forward, always get 80 by php code.

    In the Facebook SDK, base_facebook.php

    public function getLoginUrl($params=array()) {
        $this->establishCSRFTokenState();
        $currentUrl = $this->getCurrentUrl();
    

    You can see it will get url from function getCurrentUrl, go to edit it

    // use port if non default
    if(isset($_SESSION['server_port'])){
        $port = $_SESSION['server_port'];
    }else{
        $port =
          isset($parts['port']) &&
          (($protocol === 'http://' && $parts['port'] !== 80) ||
           ($protocol === 'https://' && $parts['port'] !== 443))
          ? ':' . $parts['port'] : '';
    }
    // rebuild
    return $protocol . $parts['host'] .':'. $port . $parts['path'] . $query;
    

    I preset session server_port by using javascript(can get correct port), now use it as the port by the above code, the try the following code can get correct url which can getUser() after login.

    $login_url = $facebook->getLoginUrl()
    

    PS: It seems okay if input url by my self

    $login_url = $facebook->getLoginUrl(array(
          'scope'         => 'email,publish_stream',
          'redirect_uri'  => $url
    ));
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

url: http://www.pagepilot.co.uk/pp_cftest/ When posted into facebook debugger: https://developers.facebook.com/tools/debug/og/object?q=http%3A%2F%2Fwww.pagepilot.co.uk%2Fpp_cftest%2F Keeps returning a 206 Partial Response
URL: http://mysite.com/amember/login.php?amember_redirect_url=/ajax/?id=9999 I need it to be rewritten to: http://mysite.com/amember/login.php?amember_redirect_url=/?p=9999 I mean all of
Url is: http://themediafixer.com/main.php?p=home If you resize the window so some of the content is
URL is here: http://www.thexsoft.com/DownloadFolder/download.php?file=P2PTransfer This page is basically a way for me to have
NSURL *url = [[NSURL alloc] initWithString:@http://nyxmyx.com/Kinkey/KinkeyPHP/lastidretrieve.php]; NSData *data = [url resourceDataUsingCache:YES]; NSString *string =
url : http://localhost/back-office/index.php/staff/shopping when i change the category on every onchange event i want
URL url = new URL(http://www.example.com/comment); HttpURLConnection connection = (HttpURLConnection) url.openConnection(); connection.setDoOutput(true); connection.setRequestMethod(POST); Is connection.setRequestProperty(key,
URL url = new URL(http://twitter.com/statuses/update.xml); HttpURLConnection conn = (HttpURLConnection) url.openConnection(); conn.setDoOutput(true); String cridentials =
URL url = new URL(http://soandso.com); String userpassword = username + : + password; conn
URL url = new URL(http://www.dasolorfire.freehostia.com/sound/test.wav); AudioInputStream sound = AudioSystem.getAudioInputStream(url); //Sound.java:50 DataLine.Info info = new

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.