Never been to TextSnippets before?

Snippets is a public source code repository. Easily build up your personal collection of code snippets, categorize them with tags / keywords, and share them with the world (or not, you can keep them private!)

Compile PHP5 with Fast-cgi support for lighttpd (See related posts)

The following is my setup on OS X 10.4.2 using PHP 5.0.5

./configure --prefix=/usr/local/php5-fcgi --enable-fastcgi --enable-force-cgi-redirect --disable-cli --enable-memory-limit --with-layout=GNU --with-regex=php

make

sudo make install


The compile flags enable a fairly basic PHP setup, you may need to add more options for things like MySQL, etc. DO NOT ADD --with-apxs OR --with-apxs2 AS A COMPILE FLAG -- THESE ARE APACHE ONLY AND WILL PROBABLY BREAK UNDER LIGHTTPD!

Add the following to your lighttpd.conf file

fastcgi.server = ( ".php" =>
                   ( "localhost" =>
                     ( "socket" => "/tmp/php5-fcgi.socket",
                       "bin-path" => "/usr/local/php5-fcgi/bin/php"
                     )
                   )
                 )


Restart lighttpd, now with PHP support

You need to create an account or log in to post comments to this site.


Related Posts