Environment variables in html

there is an environment variable in which I want to hide the token from the bot’s telegrams, the script is written in php and vlucas/phpdotenv is installed. I have configured all the files, but when I upload the site to html, the script does not work.

Renaming it index.html in index.php and then the site doesn’t work anymore. I am far from web development, but most likely everything is much more complicated to put a website in php.

The code looks like this. If you can help, I will be grateful, perhaps there is some easier way.

<?php
require 'vendor/autoload.php'; // Подключаем автозагрузчик Composer

$dotenv = DotenvDotenv::createImmutable(dirname('my.site.name'));

$dotenv->load();

$token = $_ENV['TOKEN']; // Используем токен из переменной окружения

// Теперь можно использовать переменную $token в вашем коде
?>

<!DOCTYPE html>
<html>

<head>

    <meta charset="utf-8">

Переименовываю index.html в index.php