服务器应用程序接口

维基百科,自由的百科全书

计算机科学中,服务器应用程序接口(Server Application Programming Interface,或SAPI)是一个網頁伺服器(如Apache HTTP Server微软IISOracle iPlanet Web Server英语Oracle iPlanet Web Server)的直接模块接口。微软使用术语ISAPI描述服务器应用程序接口,过时的網景网页服务器则使用术语网景服务器应用程序接口英语Netscape Server Application Programming Interface(NSAPI)来描述。[1]换言之,SAPI是一项由网页服务器提供的应用程序接口(API)以帮助其他开发者扩展网页服务器的功能。

举个例子,PHP有着称之为SAPI可用于不同网页服务器的直接模块接口;[2]在Windows平台上的PHP 5和Apache 2.0,PHP通过提供名为php5apache2.dllDLL文件以实现此功能。[3]此模块与其他功能一起以一种服务器理解的方式实现了PHP和网页服务器之间的接口。这种形式即人们熟知的SAPI。

多个网页服务器扩展中存在不同类型的SAPI。例如,除了上方列出的以外,PHP的其他SAPI包括通用网关接口(CGI)与命令行界面(CLI)。[2][4]

另请参阅

参考文献

  1. ^ Netscape Server Application Programming Interface (NSAPI). techtarget.com. September 2005 [2013-09-22]. (原始内容存档于2016-11-16). 
  2. ^ 2.0 2.1 General Installation Considerations. php.net. [2013-09-22]. (原始内容存档于2021-02-25). 
  3. ^ PHP: Apache 2.x on Microsoft Windows. php.net. [2013-09-22]. (原始内容存档于2013-09-26). 
  4. ^ Command line usage: Introduction. php.net. [2013-09-22]. (原始内容存档于2021-03-21). 

外部链接