I've been using Heroku to host a bunch of static sites using the Apache/PHP hack. All I need is an index.php file in the root of my application to hint to Heroku that I want the PHP (Apache) buildpack... and then I disable PHP altogether since I really just want Apache to serve a static site. But some of my recent attempts at creating these stacks have results in Heroku giving me a Node.js stack instead... WTF?!?
Turns out that some of the newer node-based tools for managing static assets require a "package.json" file, which makes Heroku think you want a Node.js stack.
Quick solution
Specify the buildpack when creating the app.
$ heroku create myapp --buildpack https://github.com/heroku/heroku-buildpack-php
Or specify the buildpack as a config parameter.
$ heroku create myapp
$ heroku config:set BUILDPACK_URL=https://github.com/heroku/heroku-buildpack-php
This will force Heroku to use the buildpack you want.
With the rapid evolution of front end tools for managing your Javascript and CSS assets, we're seeing Node-based tools crop up all over the place... In fact, Node Package Manager (npm) is quickly becoming the de facto standard for installing most new web tools. This is a great thing, however, we're really beginning to blur the lines between front and back end technologies. Since Heroku attempts to introspect an app to determine which stack to create, the existence of package.json creates confusion. And because the PHP stack even isn't officially supported, the Node stack wins. We just need to be more explicit these days.