Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Failed to detect set buildpack https://codon-buildpacks.s3.amazonaws.com/buildpacks/heroku/php.tgz

Tags:

heroku

Goal

I'm very new to Heroku, and I'm trying to deploy a very simple site into Heroku.

Site Structure

enter image description here

As you can see, I'm not trying to deploy a complex Node.js or Laravel Site here.


Steps

I log-in to heroku of course, then

cd idesign4u/
git init
heroku git:remote -a idesign4u
git add .
git commit -am "Project Initialization"
heroku buildpacks:set heroku/php

I got this

Buildpack set. Next release on idesign4u will use heroku/php.
Run git push heroku master to create a new release using this buildpack.

I thought I am all set. Then I ran

git push heroku master

Result

I kept getting

Counting objects: 67, done.
Delta compression using up to 4 threads.
Compressing objects: 100% (64/64), done.
Writing objects: 100% (67/67), 60.75 MiB | 6.16 MiB/s, done.
Total 67 (delta 2), reused 0 (delta 0)
remote: Compressing source files... done.
remote: Building source:
remote: 
remote: -----> Failed to detect set buildpack https://codon-buildpacks.s3.amazonaws.com/buildpacks/heroku/php.tgz
remote: More info: https://devcenter.heroku.com/articles/buildpacks#detection-failure
remote: 
remote:  !     Push failed
remote: Verifying deploy...
remote: 
remote: !   Push rejected to idesign4u.
remote: 
To https://git.heroku.com/idesign4u.git
 ! [remote rejected] master -> master (pre-receive hook declined)
error: failed to push some refs to 'https://git.heroku.com/idesign4u.git'

Failed to detect set buildpack https://codon-buildpacks.s3.amazonaws.com/buildpacks/heroku/php.tgz


Questions

How do I bypass that?

Are there any other settings that I need to do in the Heroku site?


Note

I found some SO post like this one here:

Push rejected, failed to detect set buildpack heroku/php

I took a look at it, but it is not really relevant in my case here.

like image 342
code-8 Avatar asked Feb 03 '17 15:02

code-8


1 Answers

It appears that you are trying to deploy a static website to Heroku but specifying the heroku/php builpack which expects, well… a PHP app.

Two possible ways of doing this:

Meet the requirements of the heroku/php webpack:

  1. Have some PHP code. For example, an index.php file with a redirect, like:

    <?php header( 'Location: /index.html' ) ; ?>

  2. Have a composer.json file, which can just be:

    {}

Use heroku-buildpack-static:

This is a custom webpack for serving static sites. A complete guide is available here, but the highlights are:

heroku plugins:install heroku-cli-static
heroku buildpacks:set https://github.com/hone/heroku-buildpack-static
heroku static:init
heroku static:deploy
like image 136
Grisha Levit Avatar answered Sep 29 '22 06:09

Grisha Levit