84

I am looking at the following demo - http://blueimp.github.com/jQuery-File-Upload/

To my understanding in the demo, php files are being served from github which means php content can be served / run from github.

I understand the process to publish html content from code hosted at github via this link -
http://help.github.com/pages/

I am just curious to know how can I show a .php page as a demo, similar to what is done in blueimp above.

I tried similar thing at http://synechron.github.com/index2.php
but instead of displaying in the browser window the page gets downloaded in Google chrome and in IE9 index.html is displayed.

starball
  • 20,030
  • 7
  • 43
  • 238
Anmol Saraf
  • 15,075
  • 10
  • 50
  • 60
  • 7
    It would be nice if gh-pages was a little more full featured. – Robert Christian Jan 12 '13 at 18:11
  • 1
    It's not about being more full-featured, it's about GitHub avoiding execution of client-side code, which introduces all sorts of cans of worms, computationally and security-wise. – charlesreid1 Jun 15 '15 at 08:10
  • 2
    @charlesreid1 You mean "server-side" code. Client-side code (JavaScript, mostly) works fine on GH Pages. But, you are right. Beside, if they offer PHP support, people would ask for Python, Perl, Java and so on... – PhiLho Oct 14 '15 at 10:11

2 Answers2

149

Github Pages is not a full-featured web host. It will not execute PHP, or any other arbitrary code.

Wooble
  • 87,717
  • 12
  • 108
  • 131
  • 1
    In that case I am more curious to know how is http://blueimp.github.com/jQuery-File-Upload/ providing a demo which is executing php code from the github directory when any of .png or .jpg image is uploaded. Thanks for answering and devoting previous time.. – Anmol Saraf May 31 '12 at 21:38
  • 31
    It doesn't. If you upload anything, it gets sent to jquery-file-upload.appspot.com, which is a Google App Engine site (which is almost certainly not running PHP, although technically it's possible to do so on the JVM using the java runtime). (I saw this through the Network tab in Chrome, but it's also mentioned at https://github.com/blueimp/jQuery-File-Upload/wiki/Demo-implementation ) – Wooble Jun 01 '12 at 12:36
  • 2
    Thanks for digging so deep and bringing up the correct reason. I just got so curious with the php publishing on github that just went into experimenting it with a .php page and missed the main 'wiki' page where the details were clearly mentioned :) Thanks once again !! – Anmol Saraf Jun 01 '12 at 12:56
  • @WoobleYes, you are right. I saw the same by checking the URL of the form-attribute action, which is targeting //jquery-file-upload.appspot.com/" – Sedat Kilinc Jul 07 '16 at 17:07
9

No, you can’t.

Github Pages let you serve web client content (HTML, Javascript, CSS) without the need of owning and maintaining a web server. You can make sub folders, map your domain into it. Use tools such as Jekyll or Hugo with some basic programming skills, you can make your site work as good as an CMS.

However, it does not allow you to use any backend technology to process and manipulate data/logic.

So, PHP is not possible.