# SAPI documentation

- Thread: https://externals.io/message/6261
- Original archive: https://news-web.php.net/php.internals/6261
- Started by Michael O'Brien on 2003-12-07T08:03:46+00:00
- Messages: 6
- Reply by email to internals@lists.php.net
- More for agents: search with https://externals.io/search.md?q={query} · JSON API at https://externals.io/api · documentation at https://externals.io/llms.txt

---

## #6261 — Michael O'Brien — 2003-12-07T08:03:46+00:00

URL: https://externals.io/message/6261#6261

Is there any documentation regarding the SAPI interface?

I'm writing a SAPI module so that I can run PHP in a new embedded
web server.

Why, do I want to do this?
Our server is designed for embedding in applications or devices and is
a fast, multi-threaded, secure, portable, small-footprint web server that 
uses an apache configuration file format. It really is like a small,
embeddable Apache. For devices or applications that want their own 
in-process personal web server, our server Mbedthis AppWeb is ideal.

I want to support PHP in an embedded fashion but am struggling to find 
documentation on the SAPI interface. I can probably work it out from the 
code, but there don't seem to be pointers about what are the expectations 
by PHP on the SAPI module. Also, there seems to be quite a bit of
diversity in the level of support offered by existing SAPI handlers.

Any help or pointers to existing information will be appreciated.

Michael O'Brien
Lead Architect
http://www.mbedthis.com

---

## #6262 — Wez Furlong — 2003-12-07T09:39:28+00:00

URL: https://externals.io/message/6261#6262 · In reply to: #6261

Hi Michael,

There is no documentation except for the source code.
I'd suggest using one of the other threaded SAPI's as
a base and go from there (isapi and/or nsapi).

--Wez.

----- Original Message ----- 
From: "Michael O'Brien" <mob@mbedthis.com>
To: <internals@lists.php.net>
Sent: Sunday, December 07, 2003 8:03 AM
Subject: [PHP-DEV] SAPI documentation


> Is there any documentation regarding the SAPI interface?
> 
> I'm writing a SAPI module so that I can run PHP in a new embedded
> web server.

---

## #6264 — Jani Taskinen — 2003-12-07T10:32:41+00:00

URL: https://externals.io/message/6261#6264 · In reply to: #6262

What about the sapi/embed ?  :)

    --Jani



>Hi Michael,
>
>There is no documentation except for the source code.
>I'd suggest using one of the other threaded SAPI's as
>a base and go from there (isapi and/or nsapi).
>
>--Wez.
>
>----- Original Message ----- 
>From: "Michael O'Brien" <mob@mbedthis.com>
>To: <internals@lists.php.net>
>Sent: Sunday, December 07, 2003 8:03 AM
>Subject: [PHP-DEV] SAPI documentation
>
>
> > […]

---

## #6271 — George Schlossnagle — 2003-12-07T16:26:30+00:00

URL: https://externals.io/message/6261#6271 · In reply to: #6264

>
>     What about the sapi/embed ?  :)

Probably not the best example of a general purpose SAPI.
>
>     --Jani

---

## #6279 — Michael O'Brien — 2003-12-08T07:43:41+00:00

URL: https://externals.io/message/6261#6279 · In reply to: #6262

Wez,

Thanks all for your responses. 

I've read the code of all the SAPI handlers and thought the nsapi
or AOL code looked like a reasonable starting base. 

I might just document this as I go. Some documentation is really 
needed in this area. As a minimum, I can comment my SAPI code well
and that will be a better guide for others.

Michael O'Brien
http://www.mbedthis.com



> Hi Michael,
> 
> There is no documentation except for the source code.
> I'd suggest using one of the other threaded SAPI's as
> a base and go from there (isapi and/or nsapi).
> 
> --Wez.
> 
> ----- Original Message ----- 
> From: "Michael O'Brien" <mob@mbedthis.com>
> To: <internals@lists.php.net>
> Sent: Sunday, December 07, 2003 8:03 AM
> Subject: [PHP-DEV] SAPI documentation
> 
> 
> > […]

---

## #6280 — Alex Leigh — 2003-12-08T07:44:40+00:00

URL: https://externals.io/message/6261#6280 · In reply to: #6279

Michael,

I've written a SAPI module for a threaded web-server, so I've been down 
this road of discovery. If you have any questions at all or want an 
overview, please feel free to get in touch with me.

Alex

--
Alex Leigh - aleigh@tessier.com - www.configuredlight.com
The difference between theory and reality
is that in theory there is no difference.


> Wez,
>
> Thanks all for your responses.
>
> I've read the code of all the SAPI handlers and thought the nsapi
> or AOL code looked like a reasonable starting base.
>
> I might just document this as I go. Some documentation is really
> needed in this area. As a minimum, I can comment my SAPI code well
> and that will be a better guide for others.
>
> Michael O'Brien
> http://www.mbedthis.com
>
> 
>
> > […]
