'Unable to deploy static website to heroku, html and css not loading from php

So I am trying to deploy static website to heroku but the main page isn't loading the html/css files.

Link to app: https://randomstockpicker.herokuapp.com/

when I looked at the source code it shows:

<?php include_once("home.html"); ?>

this php code isn't loading the "home.html" file, the file exists and is uploaded as well.

I also got composer.json : {}

I followed this tutorial: https://medium.com/@agavitalis/how-to-deploy-a-simple-static-html-website-on-heroku-492697238e48



Solution 1:[1]

The tutorial you followed asks you to rename the index.html file to a custom one (home.html), and uses a PHP file (which is a server-side scripting language) to "load" the static file.

It's not rendering the page because Heroku isn't configured to serve PHP files.

I recommend you mv home.html index.html (renaming you homepage back to index.html, which is a standard file that browsers look for) and you should see your static site.

Just as a side-note, PHP is not static, it's a dynamic scripting language, so if you're aiming at building a static site, avoid anything else than HTML + JS + CSS.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Lucian D.