Skip to main content

Heroku Php Facebook Application Development Steps

Facebook Application Development in Php
Today I'm trying to develop a sample php facebook application demonstrated in  the book 'Facebook Application Development with Graph API Cookbook ' by Shaswanth Srivasthava and Apeksha Singh. It's a raw php code given in the book but I'm trying to implement it in Heroku. I've already set-up the basic heroku environment in my Linux system.

When I had to add new files to the existing project the following steps proved to be the solution

"In a nutshell, you will use git add to start tracking new files and also to stage changes to already tracked files, then git status and git diff to see what has been modified and staged and finally git commit to record your snapshot into your history. This will be the basic workflow that you use most of the time." Reference


Commands I used

  • git add . : As mentioned above, to add new files.
  • git commit -am "--comment--" : To commit the changes
  • git push heroku : To push the committed changes to the web
  • heroku logs : This command retrieves the log from the web and display it on the command line. I use it when I find the following error message in the browser

"An error occurred in the application and your page could not be served. Please try again in a few moments.
If you are the application owner, check your logs for details."


Something I reassured on the way:

/ means the root directory
./ means the current directory
../ means the parent directory

The end.

After a 6 hour long effort I've found some success. But unfortunately, recognized some drawbacks which were never mentioned in the Heroku documentation.

  • Heroku is very much focus on Ruby on Rails
  • Heroku doesn't suppport ImageMagick but it does support GD. The support for GD is also limited and it totally avoid processing jpeg files which is very important. Again, it doesn't support functions like imagecreatefromstring() and imagecopymerge() without which I cannot complete my applications. 
I have an ideal facebook application in my mind, which I thought would be easy to implement in Heroku ( because it is officially supported by facebook itself), so I cant hit dead-ends and adjust with the limitations of the provider. I am a very application oriented person and never want to spent time on things that can't give me output within the time limit I fix. That's why I had to abandon Google App Engine previously. Now, I gotta give a halt to Heroku (atleast for now).  Well, I'm not much disappointed because I've got more clues to the direction I need to know; such as, PHP Fog has raised $1.8 million for its PaaS cloud targeting PHP developers. "Php is to PHP Fog as Ruby is to Heroku". This is what I heard.
I got a private beta account opened in PHP Fog from  via invitation from TechCrunch and now I'm gonna try my hands on PHP Fog.

Comments

Popular posts from this blog

Building Autonomous Drone with Raspberry Pi and APM 2.8

I am a total newbie to hardware and was pushing my limits to see how far I can reach on with hardware projects (which sparked my interest lately). I have set out on a very ambitions mission  to control a drone from raspberry pi .I began the research for this around 2 months ago and had brought a raspberry pi, drone body kit and apm flight controller. The key difference of this project from common drone projects is that I'm trying to avoid the use of and RC and instead use the raspberry pi to control it.  Hardware Ins tallation Setup: I am using APM 2.8 and Mission Planner. I am using RPi 3 to control the APM 2.8 via Telem port of APM I am planning to power the apm via the battery to ESC (Electronic Speed Controllers) Now, documenting my steps below: Day 1 Watch Tutorial To get started with APM flight controller, I watched this video tutorial [1] which gives a gentle introduction about APM board.  Setup APM board and Calibrate Sensors I downloade...

Adafruit GFX - How to change line spacing in text?

  You may want to update the line spacing to be a little lower than default due to small screen size on IoT devices. I faced this challenge while working on a Watchy hobby project. You may have used a font generator or just using the default fonts and got a *.h file that has the details of the font. In that case just change the last integer value in the PROGMEM variable.

Data Mining & Analytics with R : Running R Scripts and Data Mining Techniques - Day 2

Warning: These are my messy study notes, much better legible notes can be found here  http://onepager.togaware.com 1. A Tour Thru Rattle Transform Tab ( by no means near to the full power of underlying R) Data Mining Tabs - Cluster, Associate Model Log Tab  - Capture the corresponding R command Working from Left to Right on Tabs  Remember to Click Execute Button 'Save' -> Projects save the current state, all models etc. 'Open' Projects can be restored at a later time You can even load it back to R  2. First R Program Load rattle and ggplot2 library(rattle)  # Provides the weather dataset  library(rattle)  # Provides the ggplot() function ggplot -> Grammar of Graphics : Just like english grammar or grammar of a computer language. A result of Hadley's Phd . Look him up to learn more details. Then produce a plot using ggplot() # handsondatascience.com - tips on elegantly writing repeated code ds ...