GitHub页面支持PHP吗? [英] Do GitHub pages support PHP?

查看:835
本文介绍了GitHub页面支持PHP吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

感谢您抽出宝贵的时间查看我的帮助请求.

我一直在使用gh-pages为静态站点构建内容,并且在整个构建过程中,您的服务器对我来说都是惊人的!

尽管通过PHP代码将HTML Web表单提交到电子邮件时,我似乎遇到了问题.当我提交到gh-pages服务器时,收到此错误消息,提示" 405不允许ngix ".我一直在四处寻找答案.首先,我发现我的代码确实存在一些小错误,并已修复.然后,我再次使用正确的代码提交到服务器,仍然从gh-pages服务器收到相同的消息. "405不允许ngix"使我相信gh-pages服务器不支持任何PHP代码.

我在SO上找到了一些有关不支持PHP的gh-pages服务器的信息. 如何在github上发布.php页面而不是.html来演示一些php内容?

服务器端包含替代项

PHP是否可以在gh页上运行?或不?

如果不是,那么我知道我这边的一切都是正确的,并且我不必担心,因为当我真正部署此站点时,我将使用支持PHP的服务器.

这是我当前的版本,因此您可以测试我的问题. http://kapena.github.io/pp_web/#contact-pp

这是我将表单提交到服务器时得到的.

解决方案

根据定义,静态站点不能支持PHP.

  • 静态网站直接通过网络服务器的文件系统提供内容 完全存储.

  • 动态网站会根据每个请求实时生成内容.该请求是 委托给正在运行的Web应用程序来构建内容.

什么是静态网站

您可能对 PieCrust 感兴趣.它是一个 静态网站生成器.

Thank you for taking the time to review my request for help.

I've been using gh-pages to work on a build for a static site and thee server has worked amazing for me throughout the build!

Although I seem to have an issue when submitting my HTML web form to my email through PHP code. When I submit to the gh-pages server I get this error message saying "405 not allowed ngix". I've been digging around to find an answer to this. First I discovered that I did have a few minor errors in my code which I fixed. Then I submitted again to the server with the correct code and still received the same message from the gh-pages server. "405 not allowed ngix" this lead me to believe that the gh-pages server does not support any PHP code.

I found some information on SO about gh-pages server not supporting PHP. How to publish .php page instead of .html at github to demo some php content?

Server side includes alternative

Does PHP run on gh-pages? Or not?

If not then I know that everything on my side is correct and I should not worry about it because when I truly deploy this site live I'll use a server that does support PHP.

Here's my current build so you can test out my issue. http://kapena.github.io/pp_web/#contact-pp

This is what I am getting when I submit the form to the server..

解决方案

A static site cannot by definition support PHP.

  • Static websites serve content directly from the web-server’s file-system exactly as stored.

  • Dynamic websites generate content live per each request. The request is delegated to a running web-application that builds the content.

What is a Static Website

You might be interested in PieCrust. It is a static site generator.

这篇关于GitHub页面支持PHP吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆