Home php教程 php手册 什么是PHP?

什么是PHP?

Jun 21, 2016 am 09:10 AM
apache microsoft php server

PHP 是一种用来制作动态网页的服务器端脚本语言。你通过PHP和HTML创建页面。当访问者打开网页时,服务器端便会处理 PHP 指令,然后把其处理结果送到访问者的浏览器上面,就好像 ASP 或者是 ColdFusion 一样。然而,PHP 跟 ASP 或 ColdFusion 不一样的地方在于,它是跨平台的开放源代码。PHP 可以在 Windows NT 以及很多不同的 Unix 版本中执行,它也可以被编译为一个 Apache 模块,或者是一个CGI二进制文件。当被编译为 Apache 模快时,PHP 尤其轻巧方便。它没有任何繁琐程序所产生的负担,因此可以很快的返回结果,同时也不需为了保持较小的服务器内存映象,而去调整mod_perl。



除了能够用来产生你的网页的内容之外,PHP 也可以用来传送 HTTP头。你可以设定 cookies,授权管理,并将使用者重定向至新的页面。它也能好的访问很多数据库及ODBC。另外还可与各式各样的外部库集成,由此可以让你做几乎任何事情,从创建 PDF 文件到解析XML。

PHP 代码就嵌在Web页面中,因此你不必为它建立一个特别的开发环境或IDE。你用标志PHP代码(也可以将PHP设定成使用ASP形式的标志甚至是用)。PHP引擎会处理这些标志之间的任何东西。

PHP语言的语法跟C以及Perl很像。在使用前,你无须声明变量。要创建阵列以及散列(关联性阵列)也很快。PHP的初步面向对象特性还提供了组织及封装代码的简便方法。

尽管当嵌入 Apache 里面时,PHP运行最快,但在PHP相关站点上还是有关于如何使其与Microsoft IIS 以及 Netscape Enterprise Server无缝集成的操作指南。如果你还没有PHP,可以在其官方网站下载取得。在那里也可以找到一份包括PHP所有函数和特性的用户手册。

创建自己的命令
因为PHP脚本是写在 HTML 文档中的,你不必用特殊的编辑器来创建页面。不过你必须在支持PHP的服务器上面执行 PHP。如果你用的是你自己的服务器,则很容易办到。如果是通过ISP 服务处理页面,则需要联系你的 ISP 的客服小组请他们帮你安装PHP。

对于Unix系统,你必须具备基本的Unix技巧,例如会使用make以及一个C语言编译器。在你的系统上,还要有一个 ANSI C编译器,以及一个Web服务器。

对于Windows 95/NT ,你需要以下服务器之一:Microsoft Personal Web Server,Microsoft Internet Information Server 3 或4,Apache 1.3.x,或者Omni HTTPd 2.0b1。

你可以在PHP网站上找到所有安装设置PHP的相关信息。

David Sklar是Student.Net Publishing的首席信息官。

Adam Trachtenberg是Student.Net Publishing产品副主管。




Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

Video Face Swap

Video Face Swap

Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Article

Roblox: Bubble Gum Simulator Infinity - How To Get And Use Royal Keys
3 weeks ago By 尊渡假赌尊渡假赌尊渡假赌
Nordhold: Fusion System, Explained
3 weeks ago By 尊渡假赌尊渡假赌尊渡假赌
Mandragora: Whispers Of The Witch Tree - How To Unlock The Grappling Hook
3 weeks ago By 尊渡假赌尊渡假赌尊渡假赌

Hot Tools

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

Hot Topics

Java Tutorial
1666
14
PHP Tutorial
1273
29
C# Tutorial
1253
24
PHP and Python: Different Paradigms Explained PHP and Python: Different Paradigms Explained Apr 18, 2025 am 12:26 AM

PHP is mainly procedural programming, but also supports object-oriented programming (OOP); Python supports a variety of paradigms, including OOP, functional and procedural programming. PHP is suitable for web development, and Python is suitable for a variety of applications such as data analysis and machine learning.

Choosing Between PHP and Python: A Guide Choosing Between PHP and Python: A Guide Apr 18, 2025 am 12:24 AM

PHP is suitable for web development and rapid prototyping, and Python is suitable for data science and machine learning. 1.PHP is used for dynamic web development, with simple syntax and suitable for rapid development. 2. Python has concise syntax, is suitable for multiple fields, and has a strong library ecosystem.

PHP and Python: A Deep Dive into Their History PHP and Python: A Deep Dive into Their History Apr 18, 2025 am 12:25 AM

PHP originated in 1994 and was developed by RasmusLerdorf. It was originally used to track website visitors and gradually evolved into a server-side scripting language and was widely used in web development. Python was developed by Guidovan Rossum in the late 1980s and was first released in 1991. It emphasizes code readability and simplicity, and is suitable for scientific computing, data analysis and other fields.

PHP's Impact: Web Development and Beyond PHP's Impact: Web Development and Beyond Apr 18, 2025 am 12:10 AM

PHPhassignificantlyimpactedwebdevelopmentandextendsbeyondit.1)ItpowersmajorplatformslikeWordPressandexcelsindatabaseinteractions.2)PHP'sadaptabilityallowsittoscaleforlargeapplicationsusingframeworkslikeLaravel.3)Beyondweb,PHPisusedincommand-linescrip

The Continued Use of PHP: Reasons for Its Endurance The Continued Use of PHP: Reasons for Its Endurance Apr 19, 2025 am 12:23 AM

What’s still popular is the ease of use, flexibility and a strong ecosystem. 1) Ease of use and simple syntax make it the first choice for beginners. 2) Closely integrated with web development, excellent interaction with HTTP requests and database. 3) The huge ecosystem provides a wealth of tools and libraries. 4) Active community and open source nature adapts them to new needs and technology trends.

The Compatibility of IIS and PHP: A Deep Dive The Compatibility of IIS and PHP: A Deep Dive Apr 22, 2025 am 12:01 AM

IIS and PHP are compatible and are implemented through FastCGI. 1.IIS forwards the .php file request to the FastCGI module through the configuration file. 2. The FastCGI module starts the PHP process to process requests to improve performance and stability. 3. In actual applications, you need to pay attention to configuration details, error debugging and performance optimization.

What happens if session_start() is called multiple times? What happens if session_start() is called multiple times? Apr 25, 2025 am 12:06 AM

Multiple calls to session_start() will result in warning messages and possible data overwrites. 1) PHP will issue a warning, prompting that the session has been started. 2) It may cause unexpected overwriting of session data. 3) Use session_status() to check the session status to avoid repeated calls.

NGINX and Apache: Understanding the Key Differences NGINX and Apache: Understanding the Key Differences Apr 26, 2025 am 12:01 AM

NGINX and Apache each have their own advantages and disadvantages, and the choice should be based on specific needs. 1.NGINX is suitable for high concurrency scenarios because of its asynchronous non-blocking architecture. 2. Apache is suitable for low-concurrency scenarios that require complex configurations, because of its modular design.

See all articles