« 07.30 HTML5など勉強会に行ってみた | ココ | 08.05 東京出張のその後で »
2011年8月 2日
Facebookアプリ on DotCloudを試す
GAEではPHP on Java(Quercus)を動かすことはできたんやけど、libcurlが使えないのでFacebookのPHP SDKが使えないという事実にぶち当たりまして。大変悔しい思いをしたのがちょっと前。libcurl Emulatorがあるにはあるけど、どうもうまく機能しなかった。
というわけで今度は話題のDotCloudで動かせるかを確認してみようと思って、SDKに付いているサンプルコードではあるけれども試してみた。
DotCloudのアカウントを用意して、ツールを整えた後PHPのSDKをGitHubからダウンロード(3.0.2)。srcフォルダの中身を取り出して、以下のようなディレクトリ構造にする。
$ tree
.
└── fbapps
├── dotcloud.yml
└── samples
├── fb-sdk
│ ├── base_facebook.php
│ ├── facebook.php
│ └── fb_ca_chain_bundle.crt
├── index.php
└── info.php3 directories, 6 files
そしてdotcloud.ymlを以下のように作成。
www:
type: php
approot: samples
そして、DotCloudにpushでデプロイっと。
$ dotcloud push facebookapps fbapps/
# upload fbapps/ ssh://dotcloud@uploader.dotcloud.com:xxxxx/facebookapps
# rsync
Pseudo-terminal will not be allocated because stdin is not a terminal.
Warning: Permanently added '[uploader.dotcloud.com]:xxxxx,[xxx.xx.xx.xx]:xxxxx' (RSA) to the list of known hosts.
building file list ... done
samples/
samples/index.php
samples/info.php
samples/fb-sdk/
samples/fb-sdk/base_facebook.php
samples/fb-sdk/facebook.php
samples/fb-sdk/fb_ca_chain_bundle.crtsent 15.65K bytes received 119 bytes 2.43K bytes/sec
total size is 46.08K speedup is 2.92
Deployment for "facebookapps" triggered. Will be available in a few seconds.
2011-08-02 16:21:26 [api] Waiting for the build. (It may take a few minutes)
2011-08-02 16:21:26 [api] All the services are ready. Beginning the build.
2011-08-02 16:21:27 [www.0] The build started
2011-08-02 16:21:27 [www.0] Fetched code revision rsync-1312302085.42
2011-08-02 16:21:28 [www.0] Updating channel "doc.php.net"
2011-08-02 16:21:28 [www.0] Channel "doc.php.net" is up to date
2011-08-02 16:21:28 [www.0] Updating channel "pear.php.net"
2011-08-02 16:21:28 [www.0] Channel "pear.php.net" is up to date
2011-08-02 16:21:28 [www.0] Updating channel "pecl.php.net"
2011-08-02 16:21:29 [www.0] Channel "pecl.php.net" is up to date
2011-08-02 16:21:30 [www.0] Reloading nginx configuration: nginx.
2011-08-02 16:21:33 [www.0] php5-fpm: stopped
2011-08-02 16:21:33 [www.0] php5-fpm: started
2011-08-02 16:21:33 [www.0] The build finished successfully
2011-08-02 16:21:33 [api] Deploy finishedDeployment finished. Your application is available at the following URLs
www: http://XXXXXXXX.dotcloud.com/
これで一応動いた。真っ白になってしまったりしたけど、それはインクルードするSDKのファイルのパスが間違ってたり、Facebook側の設定が悪かったせい。
だがしかし、DotCloudでやりたいことはできないまま…。
By ただ at 23:10 カテゴリー ; プログラミングとか
« 07.30 HTML5など勉強会に行ってみた |
08月の記事
| 08.05 東京出張のその後で »
トラックバック
このエントリーのトラックバックURL:
http://pinmarch.sakura.ne.jp/mt/mt-tb.cgi/1756