Differences in PHP SAPIs
mod_php |
CGI | CLI |
|---|---|---|
| Writes HTTP headers to output | Writes HTTP headers to output unless '-q' given on command line |
No HTTP headers, even if header() is called |
| ini defaults are as specified in manual | ini defaults are as specified in manual |
Overrides some of the defaults:
|
chdir()s to the script directory |
chdir()s to the script directory unless '-C' given on command line |
Does not chdir() to the script directory |
| Sets superglobals appropriately, including server variables | Sets superglobals appropriately, including (part of) server’s environment | Most HTTP-related superglobals are empty arrays, except $_SESSION is NULL |
About this entry
You’re currently reading “Differences in PHP SAPIs,” an entry on Kevin's random thoughts
- Published:
- October 6th 05:44 PM
- Updated:
- October 6th 07:16 PM
- Sections:
- tech papers
0 comments
Jump to comment form | comments rss [?]