Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is SAPI and when would you use it?

Tags:

php

sapi

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

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?

like image 809
jjmorph Avatar asked Mar 30 '12 17:03

jjmorph


People also ask

What is SAPI?

The Small Arms Protective Insert (SAPI) is a ceramic ballistic plate used by the United States Armed Forces. It was first used in the Interceptor Body Armor, a ballistic vest.

What is SAPI in computer?

In computing, server application programming interface (SAPI) is the direct module interface to web servers such as the Apache HTTP Server, Microsoft IIS, and Oracle iPlanet Web Server.


1 Answers

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.

like image 171
Ignacio Vazquez-Abrams Avatar answered Sep 18 '22 14:09

Ignacio Vazquez-Abrams