Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/facebook/8.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/visual-studio-code/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
URL返回了错误的HTTP响应代码/401,Facebook共享中需要授权_Facebook - Fatal编程技术网

URL返回了错误的HTTP响应代码/401,Facebook共享中需要授权

URL返回了错误的HTTP响应代码/401,Facebook共享中需要授权,facebook,Facebook,以下是我为Facebook调试器工具所做的尝试: 刮取信息: Response Code 401 Fetched URL http://devstmaws.linesofphp.com/video/index/52f0fd544eab99ae28000106 Canonical URL http://devstmaws.linesofphp.com/video/index/52f0fd544eab99ae28000106 Warning Critical Errors That Mus

以下是我为Facebook调试器工具所做的尝试:

刮取信息:

Response Code   401
Fetched URL http://devstmaws.linesofphp.com/video/index/52f0fd544eab99ae28000106
Canonical URL   http://devstmaws.linesofphp.com/video/index/52f0fd544eab99ae28000106
Warning
Critical Errors That Must Be Fixed
Bad Response Code   URL returned a bad HTTP response code.
Warning
Errors That Must Be Fixed
Missing Required Property   The 'og:type' property is required, but not present.
Notice
Open Graph Warnings That Should Be Fixed
Inferred Property   The 'og:url' property should be explicitly provided, even if a value can be inferred from other tags.
Inferred Property   The 'og:title' property should be explicitly provided, even if a value can be inferred from other tags.
URLs
Graph API   https://graph.facebook.com/1419346681640654
Scraped URL  See exactly what our scraper sees for your URL
我想分享的URL是:

原因可能是什么?它不再是我的网站了

Scraper response: Document returned no data
元标记:

<meta property="og:image" content="http://devstmaws.linesofphp.com/static/img/logo_facebook.jpg" />
<meta property="og:image:type" content="image/jpeg" />
<meta property="og:image:width" content="300" />
<meta property="og:image:height" content="300" />
<meta property="og:title" content="Check out my awesome video!" />
<meta property="og:site_name" content="Check out my awesome video!" />
<meta property="og:description" content="SearchTheMusic gives you the ability to legally add music to your videos and share them with the world!" />
<meta property="og:url" content="http://devstmaws.linesofphp.com/video/index/52f0fd544eab99ae28000106" />


Facebook必须能够访问URL,开放图形标签才能工作,并且您的URL受密码保护。只有公共URL是可能的。您会收到与取消授权弹出窗口相同的错误。

使用Facebook的javascript SDK 我已经克服了中间步骤。 我的项目url也受密码保护

因此,我采取以下步骤:

  • 我已在项目文件夹外创建文件夹(受密码保护)。并创建一个文件,比如projectfront.php

  • 使用FacebookSDK调用函数并使用
    FB.ui({with method:feed
    ),我已经学会了一些技巧。在链接中,我使用了上述文件路径。所以现在Facebook不能滥用我

  • <?php 
     $faceproject_url='[your servar path]/outerface/projectfront.php'; 
    
    ?>
    <div class="fb-share-button" data-href="<?php echo $faceproject_url; ?>" data-type="button_count"></div>
    
     Second:
     In outerface/projectfront.php-
    I have written(with proper doctype) as:
    ......
    ........
    <script>
    function xyz()
    {
    url=[Give your target link];// it will your project page, which you want to share.
    window.location=url;
    }
    </script>
    </head>
    <body onload="xyz()">
    
    <?php 
    ob_start(); 
    ?>
    Please wait....
    </body>
    </html>
    [please do proper html]
    
    So now if any user click on your share button, share'll be successfully done and Facebook will not obstacle us. Also If you click on link on Facebook(in wall) after share, you will redirect successfully to your link defined in projectfront.php.
    
    Thanks
    Atanu Mitra
    
    
    函数sharesend()
    {
    FB.ui({
    方法:“提要”,
    链接:“[您的服务器路径]/outerface/projectfront.php”,
    图片:[如果可以,请提供图片],
    标题:[给出任何标题],
    描述:[给出任何描述],
    .....................,
    ..............
    }, 
    函数(响应){}
    );
    }
    
    outerface/projectfront.php中,我(使用适当的doctype)写了如下内容:

    。。。。。。
    ........
    函数xyz()
    {
    url=[给出你的目标链接];//它将显示你想要共享的项目页面。
    window.location=url;
    }
    请稍等。。。。
    [请输入正确的html]
    
    所以现在,如果任何用户单击您的共享按钮,共享将成功完成,Facebook不会阻碍我们。此外,如果您在共享后单击Facebook上的链接(在墙上),您将成功重定向到projectfront.php中定义的链接

    谢谢
    Atanu Mitra

    我还提供了其他方法。在这里,我删除了javascript SDK。其他都是一样的 已采取中间步骤。
    因此,我采取以下步骤: 我已经在项目文件夹(密码保护)之外创建了一个文件夹,即outerface,并创建了一个文件,比如projectfront.php 第一: 定义了一个外部url 在这里,我使用了上述文件路径。所以现在Facebook不能滥用我

    <?php 
     $faceproject_url='[your servar path]/outerface/projectfront.php'; 
    
    ?>
    <div class="fb-share-button" data-href="<?php echo $faceproject_url; ?>" data-type="button_count"></div>
    
     Second:
     In outerface/projectfront.php-
    I have written(with proper doctype) as:
    ......
    ........
    <script>
    function xyz()
    {
    url=[Give your target link];// it will your project page, which you want to share.
    window.location=url;
    }
    </script>
    </head>
    <body onload="xyz()">
    
    <?php 
    ob_start(); 
    ?>
    Please wait....
    </body>
    </html>
    [please do proper html]
    
    So now if any user click on your share button, share'll be successfully done and Facebook will not obstacle us. Also If you click on link on Facebook(in wall) after share, you will redirect successfully to your link defined in projectfront.php.
    
    Thanks
    Atanu Mitra
    
    
    
    当获取的页面URL与OG:URL不匹配时,您通常会收到此错误。

    谢谢!但在我的另一个登台服务器上运行之前。URL:w/授权也可以。我很有信心,它也可以在我的另一个登台服务器上运行,但我获得了401授权。它确实不起作用,但密码是pro登台服务器上的检测不会返回错误-它只是不断询问密码。这很烦人,因为您无法轻松关闭浏览器选项卡…您应该删除一个答案。因为两者都是相同的
    <?php 
     $faceproject_url='[your servar path]/outerface/projectfront.php'; 
    
    ?>
    <div class="fb-share-button" data-href="<?php echo $faceproject_url; ?>" data-type="button_count"></div>
    
     Second:
     In outerface/projectfront.php-
    I have written(with proper doctype) as:
    ......
    ........
    <script>
    function xyz()
    {
    url=[Give your target link];// it will your project page, which you want to share.
    window.location=url;
    }
    </script>
    </head>
    <body onload="xyz()">
    
    <?php 
    ob_start(); 
    ?>
    Please wait....
    </body>
    </html>
    [please do proper html]
    
    So now if any user click on your share button, share'll be successfully done and Facebook will not obstacle us. Also If you click on link on Facebook(in wall) after share, you will redirect successfully to your link defined in projectfront.php.
    
    Thanks
    Atanu Mitra