Florinel Chis

E-Commerce, Magento, Cloud, London

Create and Deploy a Php App to Heroku

Heroku is a great PaaS. Aside from running python or Ruby apps, you can deploy php apps as well. Here is the process to create and deploy a php app to Heroku:

deploy_heroku.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
mkdir my-app
cd my-app
git init .
nano index.php
//add some php code to index.php, like `echo "Hello Heroku"`

$git add index.php

$git commit -m "initial index.php"

$ heroku create --stack cedar
Creating random-name-1731... done, stack is cedar
http://random-name-1731.herokuapp.com/ | git@heroku.com:random-name-1731.git Git remote heroku added

$ git push heroku master
Counting objects: 6, done.
Delta compression using up to 4 threads.
Compressing objects: 100% (3/3), done.
Writing objects: 100% (6/6), 509 bytes, done.
Total 6 (delta 0), reused 0 (delta 0)
-----> PHP app detected
-----> Bundling Apache version 2.2.22
-----> Bundling PHP version 5.3.10
-----> Discovering process types
       Procfile declares types -> (none)
       Default types for PHP   -> web
-----> Compiled slug size: 9.5MB
-----> Launching... done, v4
       http://random-name-1731.herokuapp.com deployed to Heroku

Comments