mirror of
https://github.com/sigmasternchen/php-doc-en
synced 2025-03-15 16:38:54 +00:00
Added basic cli web server documentation.
git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@312768 c90b9560-bf6c-de11-be94-00142212c4b1
This commit is contained in:
parent
17028006b4
commit
5dc9ad2fb7
1 changed files with 72 additions and 1 deletions
|
@ -1579,7 +1579,78 @@ php >
|
|||
</note>
|
||||
</section>
|
||||
<!--}}}-->
|
||||
|
||||
|
||||
<!--Built-in CLI Web Server: {{{-->
|
||||
<section xml:id="features.commandline.webserver">
|
||||
<title>Built-in web server</title>
|
||||
|
||||
<para>
|
||||
As of PHP 5.4.0, the &cli.sapi; provides a built-in web server.
|
||||
</para>
|
||||
|
||||
<para>
|
||||
This web server is designed for developmental purposes only, and should not
|
||||
be used in production.
|
||||
</para>
|
||||
|
||||
<example>
|
||||
<title>Loading a file</title>
|
||||
<programlisting role="shell">
|
||||
<![CDATA[
|
||||
$ php -S localhost:8000 test.php
|
||||
]]>
|
||||
</programlisting>
|
||||
&example.outputs;
|
||||
<screen>
|
||||
<![CDATA[
|
||||
PHP Development Server is listening on localhost:8000 in . ... Press Ctrl-C to quit.
|
||||
]]>
|
||||
</screen>
|
||||
</example>
|
||||
|
||||
<example>
|
||||
<title>Loading a directory</title>
|
||||
<programlisting role="shell">
|
||||
<![CDATA[
|
||||
$ php -S localhost:8000 -t foo/
|
||||
]]>
|
||||
</programlisting>
|
||||
&example.outputs;
|
||||
<screen>
|
||||
<![CDATA[
|
||||
PHP Development Server is listening on localhost:8000 in foo/ ... Press Ctrl-C to quit.
|
||||
]]>
|
||||
</screen>
|
||||
</example>
|
||||
|
||||
<example>
|
||||
<title>Example output while making HTTP requests</title>
|
||||
<programlisting role="php">
|
||||
<![CDATA[
|
||||
<?php
|
||||
// hello.php
|
||||
echo htmlspecialchars($_GET['hello'], ENT_QUOTES, 'UTF-8');
|
||||
?>
|
||||
]]>
|
||||
</programlisting>
|
||||
<programlisting role="shell">
|
||||
<![CDATA[
|
||||
$ php -S localhost:8000 hello.php
|
||||
]]>
|
||||
</programlisting>
|
||||
&example.outputs.similar;
|
||||
<screen>
|
||||
<![CDATA[
|
||||
[Fri Jul 1 06:29:04 2011] ::1:63530: /
|
||||
[Fri Jul 1 06:29:10 2011] ::1:63532: /?hello=world
|
||||
[Fri Jul 1 06:29:11 2011] ::1:63533: /?hello=you
|
||||
]]>
|
||||
</screen>
|
||||
</example>
|
||||
|
||||
</section>
|
||||
<!--}}}-->
|
||||
|
||||
</chapter>
|
||||
|
||||
<!-- Keep this comment at the end of the file
|
||||
|
|
Loading…
Reference in a new issue