然而,如果您的服务器不支持 PHP,您必须:

安装 Web 服务器安装 PHP安装数据库,比如 MySQL

官方 PHP 网站(PHP.net)有 PHP 的安装说明:

General Installation ConsiderationsInstallation on Unix systemsApache 2.x on Unix systemsNginx 1.4.x on Unix systemsLighttpd 1.4 on Unix systemsLiteSpeed Web Server/OpenLiteSpeed Web Server on Unix systemsCGI and command line setupsOpenBSD installation notesSolaris specific installation tipsDebian GNU/Linux installation notesInstallation on macOSUsing PackagesUsing the bundled PHP prior to macOS MontereyCompiling PHP on macOSInstallation on Windows systemsInstall RequirementsPECLPHP Installer Tools on WindowsRecommended Configuration on Windows systemsManual PHP Installation on WindowsBuilding from sourceCommand Line PHP on Microsoft WindowsApache 2.x on Microsoft WindowsTroubleshooting PHP on WindowsInstallation on Cloud Computing platformsAzure App ServicesAmazon EC2FastCGI Process Manager (FPM)InstallationConfigurationInstallation of PECL extensionsIntroduction to PECL InstallationsDownloading PECL extensionsInstalling a PHP extension on WindowsCompiling shared PECL extensions with the pecl commandCompiling shared PECL extensions with phpizephp-configCompiling PECL extensions statically into PHPProblems?Read the FAQOther problemsBug reportsRuntime ConfigurationThe configuration file.user.ini filesWhere a configuration setting may be setHow to change configuration settings.


General Installation Considerations

Before starting the installation, first you need to know what do you want to use PHP for. There are three main fields you can use PHP, as described in theWhat can PHP do?section:

Websites and web applications (server-side scripting)Command line scriptingDesktop (GUI) applications

For the first and most common form, you need three things: PHP itself, a web server and a web browser. You probably already have a web browser, and depending on your operating system setup, you may also have a web server (e.g. Apache on Linux and macOS; IIS on Windows). You may also rent webspace at a company. This way, you don't need to set up anything on your own, only write your PHP scripts, upload it to the server you rent, and see the results in your browser.

In case of setting up the server and PHP on your own, you have two choices for the method of connecting PHP to the server. For many servers PHP has a direct module interface (also called SAPI). These servers include Apache, Microsoft Internet Information Server, Netscape and iPlanet servers. If PHP has no module support for your web server, you can always use it as a CGI or FastCGI processor. This means you set up your server to use the CGI executable of PHP to process all PHP file requests on the server.

If you are also interested in using PHP for command line scripting (e.g. write scripts autogenerating some images for you offline, or processing text files depending on some arguments you pass to them), you always need the command line executable. For more information, read the section aboutwriting command line PHP applications. In this case, you need no server and no browser.

With PHP you can also write desktop GUI applications using the PHP-GTK extension. This is a completely different approach than writing web pages, as you do not output any HTML, but manage windows and objects within them. For more information about PHP-GTK, please»visit the site dedicated to this extension. PHP-GTK is not included in the official PHP distribution.

From now on, this section deals with setting up PHP for web servers on Unix and Windows with server module interfaces and CGI executables. You will also find information on the command line executable in the following sections.

PHP source code and binary distributions for Windows can be found at»https://www.php.net/downloads.php.


更多相关文章

  1. PHP 服务器组件和变量
  2. 电商直播发展正夯,搭建电商网站需要怎样的云服务器配置?
  3. 云服务器的操作系统一般怎么选?选错了可以重装吗?
  4. 研招网崩了?网络崩溃的原因有哪些?怎么维护网站?
  5. 安装vscode,学习emmet语法
  6. 不安全的HTTP方法
  7. 浏览器输入域名网址访问后的过程详解
  8. vscode安装和插件推荐与emmet语法使用
  9. VSCode开发环境及插件安装

随机推荐

  1. 如何删除图例饼图中的标题?
  2. jquery datepicker,即使是另一个具有共享
  3. 为什么这个jQuery。ajax不会引发错误吗?
  4. Jquery禁用/启用按钮与文本框代码
  5. jQuery中的bind绑定事件与文本框改变事件
  6. jQuery实例:输入框下拉提示,仿google sugg
  7. 从内部获取函数名称
  8. 你什么时候需要使用$(document).ready()?
  9. 使用Selectize和Ajax时,在Bootstrap模式中
  10. 使用数字作为javascript对象元素的名称