Sunteți pe pagina 1din 23

Name: Shayan Ali

Seat#: EP1349097
th
Class:BSCS 4 Year Sec A
Course: Internet Application
Development
Topic: Deploying my app on Heroku
Submitted To:

Sir Zain Abbas

Deploying PHP My App On


Heroku
Requirement
a freeHeroku account
A Github account
Git
A cloud9 Development setup
PHPinstalled locally.
Composerinstalled.
Freemysqlhosting account

Introduction Heroku ToolBelt:

Heroku tool belt provides Command Line Interface (CLI)

used for managing pushing and scaling your applications

adding heroku add-ons

https://toolbelt.heroku.com/

Link: https://signup.heroku.com/login

Cloud 9 IDE

Cloud9 IDEis an open source IDE (integrated


development environment) platform

supports various programming languages like, Python,


PHP, Perl, JavaScript, Go and Ruby

Cloud 9 IDE

Github
Create

Github account

https://github.com/

Download git on your system Below is


the link
https://git-scm.com/downloads
Terminal

Command:

git --version

Configuration of Git

git init

command will turn on the git it will initialize empty

repository

git add .

// added all the files in git repository

git commit am initial commit

Creating Repository in
Github
Login to Github account
Click

on new repository

Name

it and create repository

Creating SSH KEY


cat

~/.ssh/id_rsa.pub

Cont.
TERMINAL
ssh

COMMAND

t git@github.com

Are

you sure you want to continue


connecting Yes/No? Answer: Yes

Go

to Slide 6 and execute the Commands

This

will push your c9 cloud environment


code to github

Creating new file


Composer.json and pushing
onto Github

git add .
//after add there is a space
git commit -am added

Upload PHP App Files

https://github.com/shayan18/firstapp/tree/master/stark-eyrie-65734

Download all the PHP App files from above link and upload them on Cloud 9

Cont.

DEPLOYING PHP APP NO


HEROKU

TERMINAL COMMAND

heroku

--version
heroku login

Cont.

TERMINAL COMMAND

heroku

keys:add

Creating App in Heroku

TERMINAL COMMAND

heroku

create

Magic Command
git push heroku master

Heroku open

Connection your SQL


database to Heroku

Go to http://www.freemysqlhosting.net/

Create account

Create database

Go to myphpadmin

In your email address there will information about

Host
Database name
Database user
Database password
Port number

Cont.

Go to https://
drive.google.com/file/d/0B_TDj79eZHnTWklxT3BGcEJieFk/view?u
sp=sharing
Download the inventory.sql file

Import inventory.sql file that you just download into


myphpadmin

Now go to your Cloud 9 and you can see a file named


database.php

Cont.

Cont.

Update the information of your dbname, dbhost,


dbusername and dbuserpassword

Run all the commands add, commit, push updates files on


git as well as heroku that I have already described

Your database should now connect to heroku application,

enjoy!! your CRUD application is now being deployed on


heroku

Any

Queries?
Thanks

S-ar putea să vă placă și