-3

but my index file is a PHP file which is not acceptable on Github. It must be index.html so I have created an index.html file that will direct me to the index.php file by using '<meta http-equiv="refresh" content="1;url=index.php">' it works on xammp but in GitHub, it shows me an empty website and it downloads index.ph I don't know why please help me to fix this problem

David
  • 208,112
  • 36
  • 198
  • 279
  • 1
    Does GitHub claim to support PHP for hosting a website? Where do you see this information? If a hosting provider doesn't claim to support something, I wouldn't expect them to support it. – David Jan 08 '22 at 14:08
  • 1
    Does this answer your question? [How to publish .php page instead of .html at github to demo some php content?](https://stackoverflow.com/questions/10837946/how-to-publish-php-page-instead-of-html-at-github-to-demo-some-php-content) – Chris Haas Jan 08 '22 at 14:19
  • GitHub Pages is a static site host. That means it supports only HTML, CSS, and JavaScript. PHP is right out. – bk2204 Jan 08 '22 at 21:27

1 Answers1

1

I'd recommend understanding how PHP and HTML work. PHP is a server side programming language, which means that whatever code you write, is executed on the server hosting the code file. Whereas, HTML is a client side scripting language, which means the code is executed at the client, i.e user's browser. Your PHP webpage runs on xammp, because xammp has the required php libraries to actually execute the code for you. This involves system resource usage (processor, memory, disk). Github Pages is a hosting service, which serves static resources that do not require a dedicated server to process the source files. Hence, no matter how much you try, you'll only be able to serve static (html) content on Github Pages.

Cierdo
  • 49
  • 3