|
Post by account_disabled on Dec 12, 2023 23:43:24 GMT -5
设置服务器可能很复杂,尤其是在安装 PHP 等语言时。如果你想拥有一台服务器来测试 WordPress,有一些东西需要学习。 不知道从哪里开始在服务器上安装 PHP?您可以通过多种方式执行此操作,具体取决于您的特定设置。在哪里下载 PHP、什么版本、需要什么才能使其工作以及如何在不同的操作系统上安装 PHP? 我们将在本 PHP 安装指南中回答所有这些问题。 开始吧! 查看我们的安装 PHP 的视频指南 什么是 PHP? PHP 徽标 PHP 徽标 PHP 是一种开源脚本语言,主要用于 Web 开发和脚本端服务器(后端)。简单来说: PHP 可以安装在服务器上来运行脚本(例如,向站点添加表单的代码块)。 它运行在服务器端而不是客户端,因此它运行在后端而不是浏览器。 它与HTML很好地集成,这使得它特别适合网络开发。 它也是最容易学习的网页脚本语言之一学习,使其成为初学者的热门选择。但它也相当强大,适合高级网站功能。 许多站点和工具都使用 PHP 及其许多扩展 听起来可能很熟悉)。 WordPress 主要基于 PHP,其大多数插件和主题也适用于 PHP。 您的服务器需要 PHP 吗? 现在您知道 PHP 是什么了,但是为什么要在 电话号码清单 服务器上安装它呢? 主要原因是让 WordPress 工作是必要的,因为 WordPress 几乎完全基于 PHP 构建。 PHP 还支持大多数 WordPress 功能、挂钩、主题和插件。 您可以在此处找到所有其他WordPress 系统要求: WordPress 要求 WordPress 要求 因此,如果您想运行服务器来测试 WordPress 或创建临时站点,则需要安装 PHP。 除此之外,PHP 对于新手开发人员来说是一个很好的起点。与其他网络脚本语言相比,它很简单,但这并不以牺牲功能为代价。如果你足够熟练,你可以用它做各种各样的事情。 PHP 也很流行。因此,您会在网上找到许多扩展和资源。 除此之外,如果你想学习如何创建 WordPress 主题和插件,你就必须学习 PHP。设置测试服务器是进行实验的好方法。 请注意,许多网络托管服务器(例如Kinsta)都预先配置了 PHP 和 WordPress。 Kinsta 还提供了创建 WordPress 临时网站的功能,因此您也可以轻松拥有它。 手动执行此操作的唯一原因是您需要在本地计算机或非托管托管环境中从头开始设置服务器。 话虽如此,让我们继续了解配置服务器的说明。 先决条件 在安装 PHP 之前,您需要确保您的服务器可以处理它。幸运的是,要求非常基本,并且大部分软件可能已经安装在您的计算机上。 如果您以前从未创建过服务器,则应查看此在多个操作系统上设置本地服务器的指南。确切的规格因您的操作系统而异,但您应该知道如何使用命令行并准备安装新软件。 无论您想在什么操作系统上安装 PHP,您都需要一个 Web 服务器才能使其工作。您可能还需要安装诸如 MySQL 之类的数据库,因此请记住这一点。 以下是每个操作系统的 PHP 先决条件,从 Linux 开始: ANSI C 编译器。 特定于模块的组件,例如 GD 图形库或 PDF 库。 可选 最后,macOS 没有先决条件,因为 PHP 与系统捆绑在一起。我们将在下面解释如何启用它。 PHP 的下载地址 如果您需要手动下载 PHP 文件,您应该从 PHP 官方网站的下载页面获取它们。 避免从第三方网站安装它,除非您知道它们是安全的,因为从第三方网站下载文件可能会导致意外安装恶意软件。 PHP下载页面 PHP下载页面 如果您要下载 Windows 计算机,请在每个版本的 PHP 中查找“Windows 下载”链接,并确保安装适当的文件。
|
|