简体   繁体   中英

How to deploy HTML to heroku?

I have home.html file, basically it's the whole source code of HTML. I also have index.php : <?php include_once("home.html"); ?> <?php include_once("home.html"); ?> . It keeps on saying language is not detected.

! No default language could be detected for this app. HINT: This occurs when Heroku cannot detect the buildpack to use for this application automatically. See https://devcenter.heroku.com/articles/buildpacks ! Push failed

To answer the question in your title, Heroku isn't really suited to hosting only static HTML. It is designed for running web applications , not web sites . I don't think Heroku even has an HTML-only buildpack, and I would strongly advise using another host for that purpose. There are many options for hosting static HTML at very low cost.

However, it sounds like what you actually want is to host PHP. Initially, Heroku's build process attempts to detect the language of your application using some basic heuristics and then uses an appropriate buildpack . (After it detects a buildpack once that buildpack will be used again in the future.)

To get Heroku to detect a PHP application you must include a composer.json file in the root directory of your project :

Heroku PHP Support will be applied to applications only when the application has a file named composer.json in the root directory. Even if an application has no Composer dependencies, it must include an empty composer.json in order to be recognized as a PHP application.

If you are using Composer to manage dependencies, you must also include your composer.lock file.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM