After getting help from Herokai, David Zuelke, I decided to create a practical guide on “Creating a Yii2 app on Cloud9 → Pushing to Github → Deploymenting to Heroku”. See below (google doc link at the top if easier to read):
https://docs.google.com/document/d/15teHaGWUWSNW_VwdV3-7bVpQHNRv2G0Z8GPFbIB-ogs/edit
1) Create the "main" Yii2 application:
290795 $ composer create-project
2) Go to the "base" directory
290795 $ cd basic/
3) Initialize a local repo for the "base" directory
basic $ git init
4) Add and transfer the Yii project
basic $ git add . basic $ git commit -m "basic Yii project"
5) Add a procfile that points to index.php (script entry) in the "web" directory
basic $ echo "web: vendor/bin/heroku-php-apache2 web/" > Procfile basic $ git add Procfile basic $ git commit -m "Procfile for Heroku"
6) Comment on the debugging information (I do it manually, not from the command line)
basic $ vim web/index.php # remove dev/debug env stuff (not my way) basic $ git add web/index.php basic $ git commit -m "remove dev/debug env"
7) This updates the dependency from v1.0.3 to v1.1 (an absolute must)
basic $ composer require fxp/composer-asset-plugin basic $ git add composer.json composer.lock basic $ git commit -m "use fxp/composer-asset-plugin in project"
8) Create a Heroku app and click on it. (Instead, I create and click on the Github repository)
basic $ heroku create basic $ git push heroku master (again I push to Github Repo synced with Heroku)
9) Add an entry to Heroku for the Yii application (without registering for Yii from the box)
basic $ echo "web: vendor/bin/heroku-php-apache2 -l runtime/logs/app.log web/" > Procfile basic $ git add Procfile basic $ git commit -m "tail runtime/logs/app.log" basic $ git push heroku master (again I push to Github Repo synced with Heroku)
10) This allows you to work with the Contact page (not sure why)
basic $ composer require ext-gd:* --ignore-platform-reqs basic $ git add composer.json composer.lock basic $ git commit -m "require GD for contact CAPTCHA" basic $ git push heroku master (again I push to Github Repo synced with Heroku)