Kevin's random thoughts - tech paperstag:kbullock.ringworld.org,2008:mephisto/papersMephisto Drax2006-10-07T00:16:32Zkbullocktag:kbullock.ringworld.org,2006-10-06:582006-10-06T22:44:00Z2006-10-07T00:16:32ZDifferences in PHP SAPIs
<table>
<tr>
<th><code>mod_php</code></th>
<th><acronym title="Common Gateway Interface">CGI</acronym></th>
<th><acronym title="Command Line Interface">CLI</acronym></th>
</tr>
<tr>
<td>Writes HTTP headers to output</td>
<td>Writes HTTP headers to output unless <code>'-q'</code> given on command line</td>
<td>No HTTP headers, even if <code><a href="http://php.net/header">header()</a></code> is called</td>
</tr>
<tr>
<td>ini defaults are <a href="http://us3.php.net/manual/en/ini.php">as specified in manual</a></td>
<td>ini defaults are <a href="http://us3.php.net/manual/en/ini.php">as specified in manual</a></td>
<td>
<p>Overrides some of the <a href="http://us3.php.net/manual/en/ini.php">defaults</a>:</p>
<ul>
<li><code><a href="http://us3.php.net/manual/en/ref.errorfunc.php#ini.html-errors">html_errors</a></code> ⇒ <code>FALSE</code></li>
<li><code><a href="http://us3.php.net/manual/en/ref.outcontrol.php#ini.implicit-flush">implicit_flush</a></code> ⇒ <code>TRUE</code></li>
<li><code><a href="http://www.php.net/manual/en/ref.info.php#ini.max-execution-time">max_execution_time</a></code> ⇒ <code>0</code> (unlimited)</li>
<li><code><a href="http://www.php.net/manual/en/ini.core.php#ini.register-argc-argv">register_argc_argv</a></code> ⇒ <code>TRUE</code></li>
</ul>
</td>
</tr>
<tr>
<td><code>chdir()</code>s to the script directory</td>
<td><code>chdir()</code>s to the script directory unless <code>'-C'</code> given on command line</td>
<td><strong>Does not</strong> <code>chdir()</code> to the script directory</td>
</tr>
<tr>
<td>Sets <a href="http://www.php.net/manual/en/language.variables.predefined.php">superglobals</a> appropriately, including server variables</td>
<td>Sets <a href="http://www.php.net/manual/en/language.variables.predefined.php">superglobals</a> appropriately, including (part of) server’s environment</td>
<td>Most HTTP-related superglobals are empty arrays, <em>except</em> <code>$_SESSION</code> is <code>NULL</code></td>
</tr>
</table>