托管 Facebook 应用程序时出现问题

发布于 2024-12-11 18:37:51 字数 1362 浏览 0 评论 0 原文

我是 Facebook 应用程序世界和网络托管方面的新手。

我在本地测试了我的 Facebook 应用程序,运行良好。但是,当我尝试放到我的服务器上时,什么也没有发生,只是一个空白页面。 当我尝试在没有 Facebook PHP-SDK 的情况下编写一些程序时,它运行良好。但是当我使用它时什么也没有发生。

我认为这是一个新手问题,但我不知道应该把它放在哪里。

我正在使用xampp,在日志中出现:

::1 - - [22/Oct/2011:19:30:15 +0100] "POST /temp/ HTTP/1.1" 200 4253 "https://apps.facebook.com/first_app_diogo/" "Mozilla/5.0 (Windows NT 6.1; WOW64; rv:7.0.1) Gecko/20100101 Firefox/7.0.1"

这是本地的,我在上面看到POST,所以它看起来像是在发出POST请求,对吧?

我的应用程序是一个画布应用程序。

我在 bytehost 中创建了一个免费的托管帐户来将我的应用程序放到网上,但不起作用,我已经尝试使用另一个网络托管,并得到了相同的结果。即使是调用 facebook API 的最简单的应用程序也不起作用...

我在 php 中激活了运行时错误报告并收到以下错误:

Fatal error: Uncaught exception 'Exception' with message 'Facebook needs the CURL PHP extension.' in /home/vol3/byethost7.com/b7_9378562/htdocs/php-sdk/src/base_facebook.php:19 Stack trace: #0 /home/vol3/byethost7.com/b7_9378562/htdocs/php-sdk/src/facebook.php(18): require_once() #1 /home/vol3/byethost7.com/b7_9378562/htdocs/config.php(3): require('/home/vol3/byet...') #2 /home/vol3/byethost7.com/b7_9378562/htdocs/index.php(6): require('/home/vol3/byet...') #3 {main} thrown in /home/vol3/byethost7.com/b7_9378562/htdocs/php-sdk/src/base_facebook.php on line 19

所以,看起来我的服务器中禁用了curl 扩展。它在本地工作,因为我在 xampp 中启用了curl 扩展。但如何在我的免费服务器中启用它? 我知道这不是一个编程问题,但我真的很困惑。

I'm new to the Facebook application world and web hosting stuff.

I tested my Facebook apps locally and it runs well. However, when I try to put on my server, nothing happens, just a blank page.
When I try to do some program without the Facebook PHP-SDK it runs well. But when I use it nothing happens.

I think this is a newbie question but I don't know where else I should put it.

I'm using xampp, in the log appears:

::1 - - [22/Oct/2011:19:30:15 +0100] "POST /temp/ HTTP/1.1" 200 4253 "https://apps.facebook.com/first_app_diogo/" "Mozilla/5.0 (Windows NT 6.1; WOW64; rv:7.0.1) Gecko/20100101 Firefox/7.0.1"

this is locally, I see POST above, so it looks like is making a POST request, right?

My app is a canvas app.

I created a free hosting account in bytehost to put my app online, but doesn't work, I already tried with another web hosting, and had the same result. Even the simplest app that calls a the facebook API doesn't work...

I activated runtime error reporting in php and got the following error:

Fatal error: Uncaught exception 'Exception' with message 'Facebook needs the CURL PHP extension.' in /home/vol3/byethost7.com/b7_9378562/htdocs/php-sdk/src/base_facebook.php:19 Stack trace: #0 /home/vol3/byethost7.com/b7_9378562/htdocs/php-sdk/src/facebook.php(18): require_once() #1 /home/vol3/byethost7.com/b7_9378562/htdocs/config.php(3): require('/home/vol3/byet...') #2 /home/vol3/byethost7.com/b7_9378562/htdocs/index.php(6): require('/home/vol3/byet...') #3 {main} thrown in /home/vol3/byethost7.com/b7_9378562/htdocs/php-sdk/src/base_facebook.php on line 19

so, it looks like the curl extension is disabled in my server. It worked locally because I enabled the curl extension in xampp. But how do I enabled it in my free server?
I know this isn't a programming question, but I'm really stuck on this.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

不再让梦枯萎 2024-12-18 18:37:51

您的服务器日志中有什么?
您的应用程序是画布应用程序还是页面选项卡应用程序?

如果是这样,请记住,在将 signed_request 传递到您的应用程序时,Facebook 将发送 POST 请求,而不是 GET 请求 - 如果您在没有任何 Facebook 集成的情况下进行本地测试,您可能会发出 GET 请求

What's in your server logs?
Is your app a canvas or page tab app?

If so, bear in mind that Facebook will send a POST request, not a GET request, when passing the signed_request to your application - if you were testing locally without any Facebook integration you were probably making GET requests

小霸王臭丫头 2024-12-18 18:37:51

我终于解决了这个问题,我的免费托管提供商不支持curl,所以我在支持curl的不同提供商中获得了另一个帐户。然而,在那之后,我遇到了 SSL 问题,因为自 01/10/2011 起每个 facebook 应用程序都需要 SSL 证书,所以我去了 http://social-server.com/index/info.php 以便通过 SSL 传送内容。
希望这可以帮助任何遇到同样问题的人。

I finnally solved it, my free hosting provider didn't support curl, so I got another account in a different provider that supports curl. However, after that, I got the SSL problem, because since 01/10/2011 every facebook app require a SSL certificate, so I went to http://social-server.com/index/info.php in order to deliver content via SSL.
Hope this helps anyone with the same problem.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文