什么是SAPI?何时使用? [英] What is SAPI and when would you use it?

查看:117
本文介绍了什么是SAPI?何时使用?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我最近一直在学习有关PHP中错误处理的知识,并且遇到了 error_log()函数.

I've been learning about error handling in PHP recently and came across the error_log() function.

在PHP手册中,它讨论了所有错误日志类型,除类型3指出错误消息直接发送到SAPI日志记录处理程序外,我了解所有的错误日志类型.我的问题是SAPI到底是什么,您什么时候要使用它?

In the PHP manual, it talks about all the error log types and I understand all of them except for type 3 which states that the error message is sent directly to the SAPI logging handler. My question is what exactly is SAPI and when would you want to use it?

推荐答案

SAPI代表服务器API"(API代表应用程序编程接口").它是控制外部世界"与PHP/Zend引擎之间的交互的机制.因此,您始终想使用它.实际上,即使不使用CLI,也无法避免使用它,因为CLI也被视为SAPI.

SAPI stands for "Server API" (and API stands for "Application Programming Interface"). It is the mechanism that controls the interaction between the "outside world" and the PHP/Zend engine. So, you would always want to use it. In fact, you cannot avoid using it without a lot of effort since even CLI is considered a SAPI.

这篇关于什么是SAPI?何时使用?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆