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

如何将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 delta降尺度计算的一些细节,有偿
  • ¥15 Arduino红外遥控代码有问题
  • ¥15 数值计算离散正交多项式
  • ¥30 数值计算均差系数编程
  • ¥15 redis-full-check比较 两个集群的数据出错
  • ¥15 Matlab编程问题
  • ¥15 训练的多模态特征融合模型准确度很低怎么办
  • ¥15 kylin启动报错log4j类冲突
  • ¥15 超声波模块测距控制点灯,灯的闪烁很不稳定,经过调试发现测的距离偏大
  • ¥15 import arcpy出现importing _arcgisscripting 找不到相关程序