Facebook之类的服务器错误500 [英] Facebook like Server error 500

查看:281
本文介绍了Facebook之类的服务器错误500的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想在我的网站页面之一上添加一个类似Facebook的按钮.但是,我被服务器错误500困扰.您看到的是,当我单击类似Facebook的插件时,它会打开Facebook登录框.输入我的登录凭据,然后登录框消失,它立即在页面的赞"按钮下方显示我的FB配置文件图像.图像然后消失,并显示一个确认"框,单击该框将显示此Server 500错误.

I wanted to add a Facebook like button to one of the pages of my website. However, I'm being bothered by this Server error 500. You see, when I click the Facebook like plugin, it opens up the facebook login box. I enter my login credentials and then the login box disappears and it momentarily displays up my FB profile image beneath the like button on the page. The image then vanishes and it displays a "Confirm" box which when clicked displays this Server 500 error.

下面是我尝试过的代码(所有代码都失败了)

Below is the code which I tried (and all of them fail)

1)放在<body>

<div id="fb-root"></div>
<script>(function(d, s, id) {
  var js, fjs = d.getElementsByTagName(s)[0];
  if (d.getElementById(id)) return;
  js = d.createElement(s); js.id = id;
  js.src = "//connect.facebook.net/en_US/all.js#xfbml=1";
  fjs.parentNode.insertBefore(js, fjs);
}(document, 'script', 'facebook-jssdk'));</script>

放置在我希望显示Flike按钮的位置.

Placed at the position wherein I wanted the Flike button to get displayed.

 <div class="fb-like" data-send="true" data-width="450" data-show-faces="true"></div>

2)<iframe src="https://www.facebook.com/plugins/like.php?href=MY_URL_HERE" scrolling="no" frameborder="0" style="border:none; width:450px; height:80px"></iframe>

为此,我在Google上进行了很多搜索,但直到发现后仍然无济于事-

I googled a lot for this but still no avail till I found this - http://mashable.com/2010/06/01/facebook-like-button-broken/

有人可以让我知道这是怎么回事吗?如果这是一个重复的问题,请在此处与正确的问题联系起来.谢谢.

Can anyone please let me know what's wrong here? If this is a duplicate question, please link this up with the correct one here. Thanks.

推荐答案

致歉,因为这是一个很晚的响应.由于您已经用yii标记了您的问题,所以让我尝试为您提供YII替代词.

Apologies, since this is a very late response. Since you've tagged your question with yii, let me try to give you a YII-alternative.

http://www.yiiframework.com/extension/faceplugs/-这是使用Open graph协议和JavaScript SDK的Facebook插件包装器.

http://www.yiiframework.com/extension/faceplugs/ - This is a wrapper for Facebook plugins using the Open graph protocol and JavaScript SDK.

在上一页中,将FB like按钮插入为-

From the above page, insert the FB like button as -

$this->widget('ext.faceplugs.LikeButton', array(
   'url' => $this->createAbsoluteUrl('/'),
   'og' => $og,
   'layout' => 'button_count',
   'action' => 'recommend',
   'colorscheme' => 'dark',
));

where,使用$og数组将打开图的属性传递给插件.

where , Open graph properties are passed to the plugin using $og array.

尝试一下,让我知道它是否适合您.

Try this and let me know if it works for you.

这篇关于Facebook之类的服务器错误500的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆