HTML5和php是否需要网络服务器? [英] Does HTML5 wih php require a webserver?

查看:184
本文介绍了HTML5和php是否需要网络服务器?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在研究带有PHP文件的YouTube HTML5表单;视频要么从包含表单的网页开始,然后链接到PHP文件,要么将所有内容都放在php文件中;我复制教师的确切文件;但它们不起作用:填写表格并点击提交"按钮后,什么也不会发布.

I am studying on YouTube HTML5 forms with PHP files; the videos either start with a web page containing the form and link to a PHP file or they put everything in php files; I copy the instructors exact files; but they do not work: nothing is posted after filling the form and hitting the submit button.

我已经将文件保存在USB闪存驱动器上,然后在计算机上进行了实际尝试:没有.

I have had the files on a USB flash drive then tried them actually on the computer: nothing.

然后我的问题是:为了使PHP文件起作用,我需要在计算机上安装一台实际的服务器吗?"

My question is then: "Do I need to have an actual server on my computer in order for PHP files to function?"

感谢您的回复.

推荐答案

是. PHP需要运行Web服务器.

您可以在自己的计算机上运行它;在本地计算机上创建和测试PHP脚本时,Web服务器没有连接到互联网.您可以在官方PHP 我需要什么页面

Yes. PHP requires a web server to run on.

You can run it on your own computer; the web server doesn't have to be connected to the internet while you are creating and testing your PHP scripts off your local machine. You can read more about this on the official PHP What do I need page

您可以下载以下本地服务器之一:

You can download one of the following local servers:

  • Windows: WAMP
  • OSX: MAMP
  • Linux: LAMP
  • XAMPP is also an option, it's cross-platform (as referenced by ATechGuy)

以下是

Here is a good explanation of Why a web server is required to run PHP. Basically it is because PHP is a dynamic server-side scripting language.

但是,如果您只想运行没有网页的简单PHP脚本.如果没有运行Web服务器,这是可能的.看到以下问题:如何在不使用php的情况下运行php网络服务器?

However if you just want to run simple PHP scripts, with no web pages. This is possible without a web server running. See this question: How can I run a php without a web server?

这篇关于HTML5和php是否需要网络服务器?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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