dongxi5423 2013-10-23 07:44
浏览 47

无法从localhost上传pic到粉丝页面 - facebook PHP SDK 3 windows xampp

  • observation: soon as i have include_once('facebook.php') the page blacks out - ie nothing shows.. i usually only included this once the app was ready to upload to fan page - could this be blocking something? causing the problem?

anyway ->

i have an app thats been working online. Im now trying to run it local and its not working.

App namespace is webcampost - i presume this is what is referred to below as app name allows spaces?

Ive setup as per this link using my webcampost for the folder name (without the :8888 though): Running Facebook application on localhost and virtual host to this: http://sawmac.com/xampp/virtualhosts/

url:http://webcampost.com/index.php (i have to specify index.php because dir listing is on in apache)

canvas url: http://webcampost.com/ & https://webcampost.com/ (<-- wont fb go looking for this online:?)

suely im ok if i specify localhost.com instead of using the virtual hosts?? I have an entry for that in my hosts file..

but its not working. the pic doesnt make i to the fan page.. the paths are relative - could there be an issue with paths from localhost to the online fanpage?

ive tried just http://localhost.com/webcamapp/ (without the virtual hosts) and also no luck, its like the webcam is stopping short soon as i click "upload to facebook".

I presume i need to gen a new token after change the URI to the local domain or not?

whats even stranger now is i cant revert BACK to my live domains! i just get a blank page - as if facebok has now leetched onto localhost and i cant revert back to my live url's!! ive even tried in another browser but no luck.

vhosts code:

NameVirtualHost *

DocumentRoot "C:\xampp\htdocs" ServerName localhost.com

DocumentRoot "C:\xampp\htdocs\webcampost" ServerName webcampost.com Order allow,deny Allow from all

app:

$pic="uploads/$name.jpg";
$params = array(
      // this is the access token for Fan Page
      "access_token" => "$accesstoken",
      "message" => "You have been entered into the competition!",
      "source" => "@" . "$pic", // ATTENTION give the PATH not URL
      //"picture" => "http://www.ifinity.co.za/webcam/boom/photo.png",
    );
     error_reporting(0);
    try {
      // path contains Facebook id of Fan page
      $ret = $fb->api('/225400744290290/photos', 'POST', $params);
     # echo '<span style="color:e3e3e3;">Photo successfully uploaded to Facebook Album / Redirect to main page</span>';
    }
  • 写回答

0条回答 默认 最新

    报告相同问题?

    悬赏问题

    • ¥15 ads仿真结果在圆图上是怎么读数的
    • ¥20 Cotex M3的调试和程序执行方式是什么样的?
    • ¥20 java项目连接sqlserver时报ssl相关错误
    • ¥15 一道python难题3
    • ¥15 用matlab 设计一个不动点迭代法求解非线性方程组的代码
    • ¥15 牛顿斯科特系数表表示
    • ¥15 arduino 步进电机
    • ¥20 程序进入HardFault_Handler
    • ¥15 oracle集群安装出bug
    • ¥15 关于#python#的问题:自动化测试