|
Post by account_disabled on Jan 6, 2024 1:20:54 GMT -5
和最新内容的需求随着网络的发展而增长。 静态页面正在步渡渡鸟的后尘。 每个人都在服务器脚本...... 现在很明显,HTML 内容必须动态创建,并且只有一个工具可以实现:CGI。 通用网关接口 (CGI) 是 Web 服务器与安装在服务器计算机上的程序进行交互的标准方式。这些程序(脚本,通常放置在名为cgi-bin的指定文件夹下)在安装服务器的操作系统中执行;也就是说,它们几乎可以用现有的任何编程语言编写。 从历史上看,CGI 脚本中最突出的地方之一是 Perl,它是一种几乎所有 *nix 机器上都安装的通用语言。当 Web 出现时,Perl 已经存在了近 10 年,对于第一批临时 Web 开发人员来说这是一个方便的选择 – 他们可以使。 用他们已经知道的语言和工具。 是的,Python 曾经存在,现在仍然存在。是的,有趣的是,到处都有许多 JavaScript 的反对者渴望旧的 Web。Perl 无处不在。 因此,他们开始编写或多或少复杂的变体:虽然 CGI 具有许多积极的特征,有时会与它更迷人的好莱坞表弟 Whatsapp 号码列表 相混淆,但其规范形式的 CGI 也有几个缺点,即当需要满足请求时必须调用新的脚本流程,并且解释该脚本。这些问题的解决方案是存在的(例如 FastCGI 和用 C/C++ 等编译语言编写脚本),但并不理想。 更重要的是,Perl 并不是被设计成一种面向 Web 开发的语言。这给开发人员带来了尴尬的体验,各种更高级别的抽象模块(如 cgi.pm)在一定程度上改善了这种体验,但还不足以阻止他们中的许多人寻找更有利的条件。 服务器。 页面 其中一项搜索引入了 PHP,它最初是为满足其创建者 Rasmus Lerdorf 的需求而编写的与 CGI 相关的 C 二进制文件的集合,后来演变为一种成熟的语言。 即使在其最早的形式中,PHP 也允许您做一些事情,这些事情将成为大多数(如果不是全部)类似服务器页面语言(例如 JSP)的通用范例:它允许您直接在HTML,一个显着的改进,可以实现更好的开发工作流程。 复制 开发人员以及网络服务器供应商并没有忽视这种便利性。除了仍然存在的将 PHP 作为 CGI 脚本运行的能力之外,Web 服务器开始实现各种模块,这些模块将在 Web 服务器本身的容器中运行 PHP 代码。 这使得网络开发人员能够: 用类似 C 的高级语言编写代码 使用 HTML 文件(有时是已经存在的文件)来增强应用程序的动态功能 不用。
|
|