Help
cancel
Showing results for 
Search instead for 
Did you mean: 
Ground Controller Lvl 1
Message 11 of 19

Re: Deploying PHP to GitHub Pages - is it possible?

umm if i put a single cgi file? will work?

Commander Lvl 3
Message 12 of 19

Re: Deploying PHP to GitHub Pages - is it possible?

@mckaygerhard No, it won’t. Read the thread - hosting PHP both isn’t possible and isn’t allowed on GitHub pages.

You however can, and should, host your PHP code with GitHub.

- Mark
Copilot Lvl 2
Message 13 of 19

Re: Deploying PHP to GitHub Pages - is it possible?

Why do you even want to host your PHP site on Github when you have proper servers like DigitalOcean, AWS and others. If it is the server hassles that you want to avoid, then there are services that provides managed PHP site hosting on these servers. As for github pages, I don't think it supports non-static sites.

Copilot Lvl 2
Message 14 of 19

Re: Deploying PHP to GitHub Pages - is it possible?

No, you cannot do that on Github Pages as it only supports static websites, i.e. sites built on html, css, JS.

Copilot Lvl 2
Message 15 of 19

Re: Deploying PHP to GitHub Pages - is it possible?

You can add php file in github repo, but it won't execute or compile your php code this is the same with google drive

 

The good thing is that you can place your php in other server then use github repo html, javascript and call the php via ajax  to load content result so you can have a dynamic page in github.

 

 

 

 

Copilot Lvl 2
Message 16 of 19

Re: Deploying PHP to GitHub Pages - is it possible?

How to do this, this is what I'm looking for. Any links or something..

I badly want the github.io to be my main portal as it sounds cool and professional. lol. All I need is for my website to be maintainable and dynamic.

Highlighted
Commander Lvl 3
Message 17 of 19

Re: Deploying PHP to GitHub Pages - is it possible?

Hi @designdust ,

 

There are a million ways to accomplish that. But the idea always is that you have the static stuff on GitHub and that uses JavaScript to load dynamic data from some place else.

 

An example would be: https://medium.freecodecamp.org/from-zero-to-deploy-how-i-created-a-static-website-from-scratch-usin...

 

However, if you have any ideas about what kind of technologies/frameworks you'd like to use, we may be able to offer a few tutorials that better fit your needs.


- Mark
Ground Controller Lvl 1
Message 18 of 19

Re: Deploying PHP to GitHub Pages - is it possible?

Presenting the project in  GitHub Pages using php is not - as mentioned in the previous response regarding ToS.

 

As also mentioned:

Deploying php source to GitHub for project management, and even posting to the destination hosted server is possiible.  Nothing in GitHub prevents this.

 

For me, this was the solution to the conundrum:

Alternate Solution: Don't use GitHub Pages for working with php projects.

 

 - Develop php locally using an OracleVM Virtual Machine configured to match your hosting server resources.

For me it was what to me seems alterately referenced as a LAMP or LEMP stack.

(Google "how to create an Oracle VM LAMP stack" for examples using your favorite Linux flavor). 

 

 - Use Git to manage the project files to be pushed to your registered domain on demand.

 - When you need to make changes to the live site - create a pull request and merge.

 

Hope this helps!

 

 

Ground Controller Lvl 1
Message 19 of 19

Re: Deploying PHP to GitHub Pages - is it possible?

Hi, Github pages only provides static page hosting. You need to buy a web hosting or Vps server for this. PHP needs a server to run the php pages. On localhost you have the option of internal servers in frameworks.