⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 install.unix.lighttpd-14.html

📁 php的帮助文档,涉及到PHP的案例和基本语法,以及实际应用内容
💻 HTML
字号:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"><html> <head>  <title>Lighttpd 1.4 on Unix systems</title>  <meta http-equiv="content-type" content="text/html; charset=UTF-8"> </head> <body><div style="text-align: center;"> <div class="prev" style="text-align: left; float: left;"><a href="install.unix.apache2.html">Apache 2.0 on Unix systems</a></div> <div class="next" style="text-align: right; float: right;"><a href="install.unix.caudium.html">Caudium</a></div> <div class="up"><a href="install.unix.html">Installation on Unix systems</a></div> <div class="home"><a href="index.html">PHP Manual</a></div></div><hr /><div id="install.unix.lighttpd-14" class="sect1"> <h2 class="title">Lighttpd 1.4 on Unix systems</h2> <p class="para">  This section contains notes and hints specific to Lighttpd 1.4 installs  of PHP on Unix systems. </p> <p class="para">  Please use the <a href="http://trac.lighttpd.net/trac/" class="link external">&raquo; Lighttpd trac</a>  to learn how to install Lighttpd properly before continuing. </p>  <p class="para">  Fastcgi is the preferred SAPI to connect PHP and Lighttpd. Fastcgi is  automagically enabled in php-cgi in PHP5.3, but for older versions configure  php with --enable-fastcgi.  To confirm that PHP has fastcgi enabled,  <i>php -v</i> should contain <i>PHP 5.2.5 (cgi-fcgi)</i>  Before PHP 5.2.3, fastcgi was enabled on the php binary (there was no php-cgi). </p>  <div id="install.unix.lighttpd-14.lighttpd-spawn" class="sect2">  <h3 class="title">Letting Lighttpd spawn php processes</h3>  <p class="para">   To configure Lighttpd to connect to php and spawn fastcgi processes, edit   lighttpd.conf. Sockets are preferred to connect to fastcgi processes on   the local system.  </p>  <div class="example">   <p><b>Example #1 Partial lighttpd.conf</b></p>   <div class="example-contents"><pre><div class="cdata"><pre>server.modules += ( &quot;mod_fastcgi&quot; )fastcgi.server = ( &quot;.php&quot; =&gt;  ((    &quot;socket&quot; =&gt; &quot;/tmp/php.socket&quot;,    &quot;bin-path&quot; =&gt; &quot;/usr/local/bin/php-cgi&quot;,    &quot;bin-environment&quot; =&gt; (      &quot;PHP_FCGI_CHILDREN&quot; =&gt; &quot;16&quot;,      &quot;PHP_FCGI_MAX_REQUESTS&quot; =&gt; &quot;10000&quot;    ),    &quot;min-procs&quot; =&gt; 1,    &quot;max-procs&quot; =&gt; 1,    &quot;idle-timeout&quot; =&gt; 20  )))</pre></div>   </pre></div>  </div>  <p class="para">   The bin-path directive allows lighttpd to spawn fastcgi processes dynamically.   PHP will spawn children according to the PHP_FCGI_CHILDREN environment   variable.  The &quot;bin-environment&quot; directive sets the environment for the   spawned processes. PHP will kill a child process after the number of   requests specified by PHP_FCGI_MAX_REQUESTS is reached. The directives   &quot;min-procs&quot; and &quot;max-procs&quot; should generally be avoided with PHP. PHP   manages its own children and opcode caches like APC will only share among   children managed by PHP. If &quot;min-procs&quot; is set to something greater than 1,   the total number of php responders will be multiplied PHP_FCGI_CHILDREN   (2 min-procs * 16 children gives 32 responders).  </p> </div> <div id="install.unix.lighttpd-14.spawn-fcgi" class="sect2">  <h3 class="title">Spawning with spawn-fcgi</h3>    <p class="para">   Lighttpd provides a program called spawn-fcgi to ease the process of   spawning fastcgi processes easier.  </p> </div> <div id="install.unix.lighttpd-14.spawn-php" class="sect2">  <h3 class="title">Spawning php-cgi</h3>  <p class="para">   It is possible to spawn processes without spawn-fcgi, though a bit of   heavy-lifting is required. Setting the PHP_FCGI_CHILDREN environment var   controls how many children PHP will spawn to handle incoming requests.   Setting PHP_FCGI_MAX_REQUESTS will determine how long (in requests) each   child will live. Here&#039;s a simple bash script to help spawn php responders.  </p>       <div class="example">   <p><b>Example #2 Spawning FastCGI Responders</b></p>   <div class="example-contents"><pre><div class="cdata"><pre>#!/bin/sh# Location of the php-cgi binaryPHP=/usr/local/bin/php-cgi# PID File locationPHP_PID=/tmp/php.pid# Binding to an address#FCGI_BIND_ADDRESS=10.0.1.1:10000# Binding to a domain socketFCGI_BIND_ADDRESS=/tmp/php.sockPHP_FCGI_CHILDREN=16PHP_FCGI_MAX_REQUESTS=10000env -i PHP_FCGI_CHILDREN=$PHP_FCGI_CHILDREN \       PHP_FCGI_MAX_REQUESTS=$PHP_FCGI_MAX_REQUESTS \       $PHP -b $FCGI_BIND_ADDRESS &amp;echo $! &gt; &quot;$PHP_PID&quot;</pre></div>   </pre></div>  </div> </div> <div id="install.unix.lighttpd-14.remote-fcgi" class="sect2">  <h3 class="title">Connecting to remote FCGI instances</h3>  <p class="para">   Fastcgi instances can be spawned on multiple remote machines in order to   scale applications.  </p>     <div class="example">   <p><b>Example #3 Connecting to remote php-fastcgi instances</b></p>   <div class="example-contents"><pre><div class="cdata"><pre>fastcgi.server = ( &quot;.php&quot; =&gt;   (( &quot;host&quot; =&gt; &quot;10.0.0.2&quot;, &quot;port&quot; =&gt; 1030 ),    ( &quot;host&quot; =&gt; &quot;10.0.0.3&quot;, &quot;port&quot; =&gt; 1030 )))</pre></div>   </pre></div>  </div> </div></div><hr /><div style="text-align: center;"> <div class="prev" style="text-align: left; float: left;"><a href="install.unix.apache2.html">Apache 2.0 on Unix systems</a></div> <div class="next" style="text-align: right; float: right;"><a href="install.unix.caudium.html">Caudium</a></div> <div class="up"><a href="install.unix.html">Installation on Unix systems</a></div> <div class="home"><a href="index.html">PHP Manual</a></div></div></body></html>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -