doucan8521 2017-02-25 06:44
浏览 151
已采纳

如何将HTML部署到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"); ?>. 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

  • 写回答

1条回答 默认 最新

  • douhan5547 2017-02-25 13:26
    关注

    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.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥15 plotBAPC画图出错
  • ¥30 关于#opencv#的问题:使用大疆无人机拍摄水稻田间图像,拼接成tif图片,用什么方法可以识别并框选出水稻作物行
  • ¥15 Python卡尔曼滤波融合
  • ¥20 iOS绕地区网络检测
  • ¥15 python验证码滑块图像识别
  • ¥15 根据背景及设计要求撰写设计报告
  • ¥20 能提供一下思路或者代码吗
  • ¥15 用twincat控制!
  • ¥15 请问一下这个运行结果是怎么来的
  • ¥15 单通道放大电路的工作原理