Monday, February 13, 2017

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

Leave a Comment

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 ?

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

How would one go about and debug this further ?


I'm opening to any suggestions at this moment.

Any hints / suggestions / helps on this be will be much appreciated !


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.

1 Answers

Answers 1

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 
If You Enjoyed This, Take 5 Seconds To Share It

0 comments:

Post a Comment