heroku logo

Currently in the process of completing this process again – will update this (very old) post in the process.

So I started out with the Getting Started for PHP on the Heroku site in my efforts to get into the cloud. The step-by-step guide on the Heroku site is fairly straightforward. I made the following notes (I am using Windows 10):

I am revisiting Heroku and must set it up on a new laptop:

  1. Download Git for Windows (https://devcenter.heroku.com/articles/getting-started-with-php#set-up)
  2. Download & install the Heroku Command Line Interface (CLI) (https://devcenter.heroku.com/articles/getting-started-with-php#set-up)
  3. You will need Composer — I used the Composer-Setup.exe — you will need to restart PowerShell
  4. and PostgreSQLhttp://www.enterprisedb.com/products-services-training/pgdownload#windows
  5. Open Windows PowerShell:
  6. I got this error trying to push changes to heroku: ERROR: File '/composer.phar' isn't executable; please 'chmod +x'!
  7. I tried the following PowerShell commands:
    • attrib +x composer.pha
    • attrib +S composer.phar
    • attrib -a composer.phar
    • I also tried to right-click Properties Security changing the permission on the file
  8. I finally found this solution — or rather workaround — on StackOverflow:
git add .
git commit -m 'composer.phar removed'
git push heroku master

However, as soon as I started trying to do more stuff with my Hello World app, I came unstuck, as it uses a whole heap of doohickies that I don’t work with, for instance, it uses the Symfony framework.

I personally prefer to start from a blank canvas as such without the additional bumf, using vanilla PHP. Here is my very simple “Hello World”:

  1. I had renamed my app: heroku apps:rename foxbeefly
  2. I deleted my app: heroku apps:destroy foxbeefly
  3. To confirm deletion: heroku apps
  4. I created a new app on Heroku: foxbeefly
  5. I created new dir in my htdocs: foxbeefly
  6. I initialised the git repo: git init
  7. created the repo: heroku git:remote -a foxbeefly
  8. I created a simple index.php
  9. I added my file to the repo: git add .
  10. I committed: git commit -m "Initial commit of new app"
  11. push changes: git push heroku master
  12. Opened my new app: heroku open and your app should open in your default browser
  13. If you go to your dashboard you will now see some resources
  14. Use heroku logs --tail to look for any errors

My “Hello World!” Heroku app is here: https://foxbeefly.herokuapp.com/

By foxbeefly

PHP / MySQL Developer. HTML, CSS and some JavaScript.

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.