there is official document to do this, it is applicable both to linux and windows.
the link is :
https://devcenter.heroku.com/articles/facebook
It is not very diffcult althoug sometimes you do not know what dose it mean. Heroku helps us save the time to setup a server thus we could focus on the desining the app code.
But for most of the beginner, I think you would run into the following problems if it is your first time to use the above link.
For Heroku
1. we use heroku toolbelt, git version of control system to interact with the server with our local machine. So, pls remeber to add your %path%.
2. if you still run into:
fatal: Not a git repository (or any of the parent directories): .git
pls remember to do the following:
git init
git add . #the '.' after add should be typed
git commit -m 'Initial commit'
3.if you need to change the configure of git, you can find it in the .git folder, which is a hidden child folder of your app folder.
4. if your local os is linux, it will redirect you to: https://toolbelt.heroku.com/debian to install the heroku toolbelt.
you should paste this to your terminal and run:
wget -qO- https://toolbelt.heroku.com/install-ubuntu.sh | sh
in the mid of it, you will have to agree with one license term where it shows you <ok>. if you directly enter return, it will fail, then pls press "tab" first ,then press return.
5. when you run into:
The authenticity of host 'heroku.com (50.19.85.132)' can't be established.
RSA key fingerprint is *some.random.fingerprint.
some people suggest:
in .git/config, changed the project name in [remote "heroku"] to the name given by heroku
I do not know what dose it exactly mean, and I just jump it and without modifying anything, so far, the app still works fine.
6. if you have modified the codes, and you want to run the two commands:
$ git commit -am "changed greeting"
$ git push heroku
before you do that, make sure you have cd into your app folder. otherwise, it may not detect any modification of your app
For Localhost
If you want to develop the app locally, this post seems fine for me:
http://www.7tech.co.in/php/how-to-create-a-facebook-application-using-php/
you should build you local machine as a server first, the normal
WAMP is ok.
then when you choose to create new app, you should remeber the app id and app secret, and do not select using heroku as server.
while in the site url: you should input: http://localhost/myapp/
and for the canvas page url you could use the same addrss
for canvas secure url you could use: https://localhost/myapp/ instead.
I love tennis and programming. I am not genius, so I collect the knowledge piece by piece.
Showing posts with label php. Show all posts
Showing posts with label php. Show all posts
Wednesday, March 6, 2013
Thursday, February 28, 2013
Using php to send mail on apache (ubuntu)
I have an Ubuntu in Oracle VM VirtualBox, however i did not set it as a server, I just want to implement sending email on ubuntu.
Make it short:using sendmail.
installing sendmail on ubuntu
in the file: /etc/php5/apache2/php.ini
make it like this: sendmail_path = /usr/sbin/sendmail -t -i
then we can use the following code to send mail:
this is only a test, you can change the code according to your demand.
done!
Make it short:using sendmail.
installing sendmail on ubuntu
in the file: /etc/php5/apache2/php.ini
make it like this: sendmail_path = /usr/sbin/sendmail -t -i
sudo apt-get install sendmail sudo apt-get install sendmail-cf
then we can use the following code to send mail:
this is only a test, you can change the code according to your demand.
done!
using php to send mail on iis(windows server 2008)
I know php might show better performance on apache, however it happened that I only have a windows server 2008 on amazon EC2 with iis installed. A senior student want me to finish the sending mail function with using php, so I have no other choice so far.
It seems very easy, every one know that php has the function mail(). But, this function only could easily run on linux almost without any configuration, while on windows, it is another story.
I spent days to find that there two basic methods:
1. directly use the SMPT service on iis
2. use some other classes: phpmailer or swiftermailer
I choose the 2nd method first, unluckily, no matter how I configure, it dose not work, so far, I still do not know why.(still think about it)
then I switched to 1st method,
in windows server2008, the smpt server is not installed by default, so you should install and configure them,
I use the following two steps to finish the task:
1:to install the smtp server:
http://www.iis.net/learn/application-frameworks/install-and-configure-php-on-iis/configure-smtp-e-mail-in-iis-7-and-above
2. configuration and code testing
http://geekswithblogs.net/tkokke/archive/2009/05/31/sending-email-from-php-on-windows-using-iis.aspx
done!
It seems very easy, every one know that php has the function mail(). But, this function only could easily run on linux almost without any configuration, while on windows, it is another story.
I spent days to find that there two basic methods:
1. directly use the SMPT service on iis
2. use some other classes: phpmailer or swiftermailer
I choose the 2nd method first, unluckily, no matter how I configure, it dose not work, so far, I still do not know why.(still think about it)
then I switched to 1st method,
in windows server2008, the smpt server is not installed by default, so you should install and configure them,
I use the following two steps to finish the task:
1:to install the smtp server:
http://www.iis.net/learn/application-frameworks/install-and-configure-php-on-iis/configure-smtp-e-mail-in-iis-7-and-above
2. configuration and code testing
http://geekswithblogs.net/tkokke/archive/2009/05/31/sending-email-from-php-on-windows-using-iis.aspx
done!
about the php session for ajax
In fact, there is nothing serious, i just want to say that the php session in index.html and in the php files which is used to respond to the ajax could share the same $_SESSION[];
however, you should not forget one thing, in the php files responding to the ajax, should write:
I only know this today, which grealy faciliate my work!
however, you should not forget one thing, in the php files responding to the ajax, should write:
session_start();
I only know this today, which grealy faciliate my work!
Subscribe to:
Posts (Atom)