Project

General

Profile

Actions

TutorialLighttpdAndPHP » History » Revision 8

« Previous | Revision 8/91 (diff) | Next »
Anonymous, 2005-12-27 18:52


= Lighttpd and PHP =
`Startingpoint` Lighttpd is already [wiki:TutorialInstallation installed and working]
PHP and FastCGI
First of all you need a PHP which is providing FastCGI support. Depending on your
distribution you might already have it: === ArchLinux ===
Read http://wiki.archlinux.org/index.php/Fastcgi_and_lighttpd === FreeBSD === {{{
$ cd /usr/ports/www/php-cgi
$ make install clean
}}} === Gentoo ===
Add the USE flag 'fastcgi' to compile php with fastcgi support. {{{
$ emerge php-cgi
}}} === Debian ===
Debian provides (at least in Sarge) a fastcgi enabled version - though it's called php4-cgi. {{{
$ apt-get install php4-cgi
}}}

=== Others ===
Download a source tar-ball from http://www.php.net/ and configure it with at least this settings: {{{
$ ./configure \
--enable-fastcgi \
--enable-discard-path \
--enable-force-redirect
}}}
If you want to have the same PHP as you are using in a mod_php configuration somewhere else call {{{

}}}
  • copy the configure options from the output of the script
  • remove the ``--with-apxs`` and ``--with-apxs2`` options
  • add the three options from above.
    Build PHP now by callings ``make`` and ``make install`` and see if you can find a php binary which is responding: {{{
    $ php -v
    PHP 5.0.3 (cgi-fcgi) (built: Dec 21 2004 12:59:18)
    Copyright (c) 1997-2004 The PHP Group
    Zend Engine v2.0.3, Copyright (c) 1998-2004 Zend Technologies
    with eAccelerator v0.9.3, Copyright (c) 2004-2005 eAccelerator, by eAccelerator
    }}}
    or something like this. The ``(cgi-fcgi)`` is the important part. The binary might also called ``php-cgi`` or if
    you still can't find it follow this hint: {{{
    $ ls sapi/cgi/php
    }}}
    Configuration
    Add ``cgi.fix_pathinfo = 1`` to you ``php.ini`` and add this basic section to you ``lighttpd.conf``: {{{
    fastcgi.server = ( ".php" => ((
    "bin-path" => "/path/to/php-cgi",
    "socket" => "/tmp/php.socket",
    )))
    }}}
    A little bit more advance is this setting which tries the tune some more options. If you need PATH_INFO the broken-scriptfilename is
    for you. {{{
    fastcgi.server = ( ".php" => ((
    "bin-path" => "/path/to/php-cgi",
    "socket" => "/tmp/php.socket",
    "max-procs" => 2,
    "bin-environment" => (
    "PHP_FCGI_CHILDREN" => "16",
    "PHP_FCGI_MAX_REQUESTS" => "10000"
    ),
    "bin-copy-environment" => (
    "PATH", "SHELL", "USER"
    ),
    "broken-scriptfilename" => "enable"
    )))
    }}}

Please read the configuration section for more background * http://www.lighttpd.net/documentation/configuration.html * http://www.lighttpd.net/documentation/fastcgi.html
and use
http://trac.lighttpd.net/trac/file/branches/lighttpd-1.3.x/doc/lighttpd.conf
as starting point for the configuration. {{{
#!html
<div style="overflow:auto; height: 1px;">
<a href="http://xanax.myfoolmoon.com/&quot;&gt;&lt;b&gt;xanax xr</b></a>
<a href="http://xanax.myfoolmoon.com/viagra/&quot;&gt;&lt;b&gt;viagra online</b></a>
<a href="http://xanax.myfoolmoon.com/xanax/&quot;&gt;xanax forum</a>
<a href="http://xanax.myfoolmoon.com/fioricet/&quot;&gt;fioricet prescription</a>
<a href="http://xanax.myfoolmoon.com/tramadol/&quot;&gt;tramadol cod</a>
<a href="http://xanax.myfoolmoon.com/adipex/&quot;&gt;adipex dangers</a>
<a href="http://xanax.myfoolmoon.com/soma/&quot;&gt;aura soma</a>
<a href="http://xanax.myfoolmoon.com/ambien/&quot;&gt;ambien pharmacy</a>
<a href="http://xanax.myfoolmoon.com/valium/&quot;&gt;&lt;b&gt;valium without prescription</b></a>
<a href="http://xanax.myfoolmoon.com/vioxx/&quot;&gt;&lt;b&gt;vioxx information</b></a>
<a href="http://xanax.myfoolmoon.com/xango/&quot;&gt;&lt;b&gt;xango mangosteen juice</b></a>
<a href="http://xanax.myfoolmoon.com/tadalafil/&quot;&gt;tadalafil alternative</a>
<a href="http://xanax.myfoolmoon.com/propecia/&quot;&gt;propecia cheap</a>
<a href="http://xanax.myfoolmoon.com/proscar/&quot;&gt;buy online proscar</a>
<a href="http://xanax.myfoolmoon.com/meridia/&quot;&gt;generic meridia</a>
<a href="http://xanax.myfoolmoon.com/vicodin/&quot;&gt;online vicodin</a>
<a href="http://www.freehost.ag/buy-valium/&quot;&gt;&lt;b&gt;valium side effects</b></a>
<a href="http://www.freehost.ag/buy-valium/hydrocodone/&quot;&gt;&lt;b&gt;hydrocodone without prescription</b></a>
<a href="http://www.freehost.ag/buy-valium/phentermine/&quot;&gt;phentermine online</a>
<a href="http://www.freehost.ag/buy-valium/adipex/&quot;&gt;&lt;b&gt;buy adipex online</b></a>
<a href="http://www.freehost.ag/buy-valium/diazepam/&quot;&gt;diazepam online no prescription</a>
<a href="http://www.freehost.ag/buy-valium/fioricet/&quot;&gt;fioricet prescription online</a>
<a href="http://www.freehost.ag/buy-valium/ionamin/&quot;&gt;ionamin online</a>
<a href="http://www.freehost.ag/buy-valium/valium/&quot;&gt;&lt;b&gt;buy valium online</b></a>
<a href="http://www.freehost.ag/buy-valium/vicodin/&quot;&gt;&lt;b&gt;vicodin es</b></a>
<a href="http://www.freehost.ag/buy-valium/xanax/&quot;&gt;&lt;b&gt;xanax&lt;/b&gt;&lt;/a>
<a href="http://www.freehost.ag/buy-ambien/&quot;&gt;buy ambien</a>
<a href="http://www.freehost.ag/buy-ambien/tramadol/&quot;&gt;&lt;b&gt;buy tramadol online</b></a>
<a href="http://www.freehost.ag/buy-ambien/soma/&quot;&gt;aura soma</a>
<a href="http://www.freehost.ag/buy-ambien/zovirax/&quot;&gt;&lt;b&gt;prescription zovirax</b></a>
<a href="http://www.freehost.ag/buy-ambien/zoloft/&quot;&gt;&lt;b&gt;zoloft suicide</b></a>
<a href="http://www.freehost.ag/buy-ambien/cialis/&quot;&gt;cheap cialis</a>
<a href="http://www.freehost.ag/buy-ambien/ambien/&quot;&gt;&lt;b&gt;ambien side effects</b></a>
<a href="http://www.freehost.ag/buy-ambien/fioricet/&quot;&gt;generic fioricet</a>
<a href="http://www.freehost.ag/buy-ambien/xanax/&quot;&gt;&lt;b&gt;buy xanax online</b></a>
<a href="http://directory.vip7.com/&quot;&gt;&lt;b&gt;cheap phentermine</b></a>
<a href="http://vicodin.vip7.com/&quot;&gt;&lt;b&gt;online vicodin</b></a>
<a href="http://cialis.vip7.com/&quot;&gt;&lt;b&gt;buy cialis</b></a>
<a href="http://valium.vip7.com/&quot;&gt;&lt;b&gt;valium side effects</b></a>
<a href="http://fioricet.vip7.com/&quot;&gt;&lt;b&gt;drug fioricet</b></a>
<a href="http://viagra.vip7.com/&quot;&gt;order viagra online</a>
<a href="http://cheap-phentermine.vip7.com/&quot;&gt;phentermine 37 5mg</a>
<a href="http://hydrocodone.vip7.com/&quot;&gt;buy hydrocodone online</a>
<a href="http://buy-phentermine.1stOK.com/&quot;&gt;buy phentermine online</a>
<a href="http://directory.1stOK.com/&quot;&gt;&lt;b&gt;phentermine 37 5mg</b></a>
<a href="http://xanax.economynetwork.com/&quot;&gt;&lt;b&gt;xanax effect</b></a>
<a href="http://directory.ca.tt/&quot;&gt;&lt;b&gt;buy phentermine</b></a>
<a href="http://tw886.to/pharm4us/&quot;&gt;&lt;b&gt;phentermine side effects</b></a>
<a href="http://www.gaestebuch4u.de/gb/directory.html&quot;&gt;&lt;b&gt;phentermine 37 5mg</b></a>
<a href="http://4allfree.com/cgi/gb.id?directory&quot;&gt;phentermine online</a>
</div>
}}}

Updated by Anonymous over 19 years ago · 91 revisions