Is there any way to convert index.php to index.html to host at github

Mr.montez

Elite Member
Jr. VIP
Joined
May 31, 2020
Messages
1,766
Reaction score
633
Hello BHW i am just wondering is there any way to host a dynamic website to github, tried just changing the file from php to html but some of the files got curropted! So is there any tutorial you recommend that i must watch to get this thing worked?
 
Hello BHW i am just wondering is there any way to host a dynamic website to github, tried just changing the file from php to html but some of the files got curropted! So is there any tutorial you recommend that i must watch to get this thing worked?
No.
Code:
https://docs.github.com/en/free-pro-team@latest/github/working-with-github-pages/about-github-pages

GitHub Pages does not support server-side languages such as PHP, Ruby, or Python.
 
No.
Code:
https://docs.github.com/en/free-pro-team@latest/github/working-with-github-pages/about-github-pages

GitHub Pages does not support server-side languages such as PHP, Ruby, or Python.
Okay but as in general how to change the index.php file into index.html file?
 
You place the index.php on a web server that supports PHP, you visit the page in your browser, you view the source and copy the HTML code and save it as index.html.
Thank you so much for the help will try this :)
 
The different between .html and .php is that:
index.php can read and recognize html elements and tags + the php syntax,
while index.html can NOT read and recognize the php syntax. that means any php code inside index.html won't work.

For example we have that code:

PHP:
<?php

echo "Hello from PHP";

?>

<br>

<h1>Hello from HTML<h1/>

If we put it inside index.php , it will print:
Hello from PHP
Hello from HTML

but if we put it in index.html , it will print:
Hello from HTML

Conclusion:
Any php code inside index.html won't work

Solution:
You can use API backend and use javaScript to communicate with the php backend through the HTML page.
 
The different between .html and .php is that:
index.php can read and recognize html elements and tags + the php syntax,
while index.html can NOT read and recognize the php syntax. that means any php code inside index.html won't work.

For example we have that code:

PHP:
<?php

echo "Hello from PHP";

?>

<br>

<h1>Hello from HTML<h1/>

If we put it inside index.php , it will print:
Hello from PHP
Hello from HTML

but if we put it in index.html , it will print:
Hello from HTML

Conclusion:
Any php code inside index.html won't work

Solution:
You can use API backend and use javaScript to communicate with the php backend through the HTML page.
Thank you for this you explained every detail now i get all the problem but i am not a tech guy this may be basic to some of the guys here but its really new to me, I will look into how to create API backened and communicate it with javascript. Thank you for this explanation :)
 
Thank you for this you explained every detail now i get all the problem but i am not a tech guy this may be basic to some of the guys here but its really new to me, I will look into how to create API backened and communicate it with javascript. Thank you for this explanation :)

if you want to get started with php frontend and backend i suggest you Laravel it's php framework and it easy, just need the php basics and you are good to go, there is a lot of youtube free courses to learn from.
and you can learn javaScript basics as well and go for Vuejs ( a javaScript framework ) so you can make "Single Web Application" that works only with one page (index.html).

if you learned Laravel as backend and Vuejs as frontend you can make SPA (Single Web Application) that works only with one page (index.html).

Not only that, you can even make Mobile apps as PWA (Progressive Web Application) using: Laravel as backend and Vuejs + Framework7 as frontend
 
if you want to get started with php frontend and backend i suggest you Laravel it's php framework and it easy, just need the php basics and you are good to go, there is a lot of youtube free courses to learn from.
and you can learn javaScript basics as well and go for Vuejs ( a javaScript framework ) so you can make "Single Web Application" that works only with one page (index.html).

if you learned Laravel as backend and Vuejs as frontend you can make SPA (Single Web Application) that works only with one page (index.html).

Not only that, you can even make Mobile apps as PWA (Progressive Web Application) using: Laravel as backend and Vuejs + Framework7 as frontend
Thank you will start by what you recommended you really helped me alot man thanks much appreciated
 
a little off topic but why don't you just host the php file with some free host. infinityfree comes to mind. have you checked them out yet? github only allows static pages.
 
a little off topic but why don't you just host the php file with some free host. infinityfree comes to mind. have you checked them out yet? github only allows static pages.
I tried all the free hosts but to be honest they are not good inifinityfree when i send bunch of traffic to my website the CPU gets heated up and my website gets down for 24hours i think github and google cloud are suitable and they are really working great the speed to load my website is awesome and they are reliable as well thats why
 
Back
Top