php 什么软件文件打开_什么是PHP文件(以及如何打开一个文件)?

php 什么软件文件打开_什么是PHP文件(以及如何打开一个文件)?

php 什么软件文件打开

php 什么软件文件打开_什么是PHP文件(以及如何打开一个文件)?

A file with the .php file extension is a plain-text file that contains the source code written in the PHP (it’s a recursive acronym meaning PHP: Hypertext Preprocessor) programming language. PHP is often used to develop web applications that are processed by a PHP engine on the web server.

具有.php 文件扩展名文件是纯文本文件,其中包含用PHP(这是一种递归的缩写,表示PHP:超文本预处理器)编程语言编写的源代码。 PHP通常用于开发由Web服务器上PHP引擎处理的Web应用程序。

什么是PHP文件? (What Is a PHP File?)

PHP was created in 1994 by Rasmus Lerdorf as a simple set of scripts written in the C programming language. Its primary purpose was to track visitors who viewed his online resume. He initially called these scripts “Personal Home Page Tools” (PHP Tools) and would later rename them to FI (Forms interpreter), and then PHP/FI, before finally deciding on its current recursive name. PHP is used by 78.9% of all websites whose server-side programming language is known.

PHP由Rasmus Lerdorf于1994年创建,它是用C编程语言编写的一组简单脚本。 其主要目的是跟踪查看过他的在线简历的访问者。 他最初将这些脚本称为“个人主页工具”(PHP工具),后来将它们重命名为FI(表单解释器),然后重命名为PHP / FI,最后确定其当前的递归名称。 已知服务器端编程语言的所有网站中,有78.9%使用PHP。

PHP files are processed by web servers using an interpreter, which executes the code and then combines the results (which can be any kind of data, like queries from a database or images) with dynamically generated HTML to form the webpage you see. This prevents any of the PHP code from actually being viewed by the user, even when looking at a page’s source code.

Web服务器使用解释器处理PHP文件,该解释器执行代码,然后将结果(可以是任何类型的数据,例如来自数据库或图像的查询)与动态生成HTML组合在一起,形成您所看到的网页。 即使在查看页面的源代码时,这也可以防止用户实际查看任何PHP代码。

Often when you fill out a form online or submit contact details to a website the backend code will send that information to a server using a script inside the PHP file. WordPress is heavily based using PHP files.

通常,当您在线填写表格或向网站提交联系方式时,后端代码会使用PHP文件中的脚本将该信息发送到服务器。 WordPress主要使用PHP文件。

我如何打开一个? (How Do I Open One?)

Since PHP files are plain-text files that are human-readable, all you need to view one is a simple text editor like Notepad, Notepad++, Sublime Text, Vi, and so on.

由于PHP文件是易于阅读的纯文本文件,因此,您需要查看的就是一个简单的文本编辑器,例如Notepad,Notepad ++,Sublime Text,Vi等。

RELATED: How To Replace Notepad with Another Text Editor in Windows

相关: 如何在Windows中用另一个文本编辑器替换记事本

If you only need to take a quick look inside a file, you can use Notepad and not have to download any other software. If you plan on editing the code, we recommend using an editor that correctly formats PHP code. I’ll be using Notepad++ on Windows in my example.

如果只需要快速浏览文件内部,则可以使用记事本,而不必下载任何其他软件。 如果您打算编辑代码,建议您使用正确格式化PHP代码的编辑器。 在示例中,我将在Windows上使用Notepad ++。

By default, when you install a text editor like Notepad++ it will associate most text/programming file extensions automatically, so double-clicking the file should open it up inside the program.

默认情况下,当您安装文本编辑器(如Notepad ++)时,它将自动关联大多数文本/编程文件扩展名,因此,双击该文件应在程序内部打开它。

php 什么软件文件打开_什么是PHP文件(以及如何打开一个文件)?

If that doesn’t work, then you can right-click the file and choose your favorite text editor from the “Open With” list provided.

如果这不起作用,则可以右键单击该文件,然后从提供的“打开方式”列表中选择您喜欢的文本编辑器。

php 什么软件文件打开_什么是PHP文件(以及如何打开一个文件)?

The same holds true on other platforms like macOS and Linux.

在其他平台(例如macOS和Linux)上也是如此。



If you’re trying to run or execute PHP files, you will need to download and install PHP on your computer to compile the code. For this, you can use a local server such as Varying Vagrant Vagrants, WampServer, or XAMPP.

如果您试图运行或执行PHP文件,则需要在计算机上下载并安装PHP来编译代码。 为此,您可以使用本地服务器,例如Varying Vagrant VagrantsWampServerXAMPP

RELATED: How to Install PHP on IIS 7 for Windows Server 2008

相关文章 如何在Windows Server 2008的IIS 7上安装PHP

翻译自: https://www.howtogeek.com/369069/what-is-a-php-file-and-how-do-i-open-one/

php 什么软件文件打开