USE="php" emerge lighttpd will install (among other things) php-cgi and use this to handle php pages. However, its configuration out of the box, php-cgi is built without USE="fastcgi". fastcgi is necessary for lighttpd to use its php support without extensive config file changes. Indeed, the default /etc/lighttpd.conf assumes that php is built with fastcgi. This is with php-cgi-4.4.0-r5 and lighttpd-1.3.16. Reproducible: Always Steps to Reproduce: 1. On a fresh system, with 'php' in its useflags, emerge lighttpd. 2. After making sure that the fastcgi part is uncommented in /etc/lighttpd.conf and handling php files, /etc/init.d/lighttpd start. 3. Actual Results: [other dependencies omitted] [ebuild N ] dev-php/php-cgi-4.4.0-r5 -fastcgi [ other useflags omitted] 4,340 kB [ebuild N ] www-servers/lighttpd-1.3.16 +ipv6 -ldap -mysql +php +ssl -xattr 689 kB Expected Results: Either used PHP in regular CGI mode in its default config, or made sure to compile php-cgi with +fastcgi. Portage 2.0.51.22-r3 (default-linux/x86/2005.1, gcc-3.3.6, glibc-2.3.5-r2, 2.6.12-co-0.7.1 i686) ================================================================= System uname: 2.6.12-co-0.7.1 i686 AMD Athlon(tm) XP 2600+ Gentoo Base System version 1.6.13 dev-lang/python: 2.3.4, 2.4.2 sys-apps/sandbox: 1.2.12 sys-devel/autoconf: 2.13, 2.59-r6 sys-devel/automake: 1.4_p6, 1.5, 1.6.3, 1.7.9-r1, 1.8.5-r3, 1.9.6-r1 sys-devel/binutils: 2.15.92.0.2-r10 sys-devel/libtool: 1.5.20 virtual/os-headers: 2.6.11-r2 ACCEPT_KEYWORDS="x86" AUTOCLEAN="yes" CBUILD="i386-pc-linux-gnu" CFLAGS="-O2 -mcpu=i686 -pipe -fomit-frame-pointer" CHOST="i386-pc-linux-gnu" CONFIG_PROTECT="/etc /usr/kde/2/share/config /usr/kde/3/share/config /usr/share/config /var/qmail/control" CONFIG_PROTECT_MASK="/etc/gconf /etc/env.d" CXXFLAGS="-O2 -mcpu=i686 -pipe -fomit-frame-pointer" DISTDIR="/usr/portage/distfiles" FEATURES="autoconfig distlocks sandbox sfperms strict" GENTOO_MIRRORS="http://distfiles.gentoo.org http://distro.ibiblio.org/pub/Linux/distributions/gentoo" PKGDIR="/usr/portage/packages" PORTAGE_TMPDIR="/var/tmp" PORTDIR="/usr/portage" USE="x86 3dnow 3dnowext X aac aalib acpi aim aimextras async audiofile automount avi berkdb bidi bzip2 cap cdparanoia cdr chroot clock-screen cpudetection crypt cups curl dga dri dvd dvdread eds emboss encode esd expat foomaticdb fortran gdbm gif glut gpm gstreamer gtk gtk2 ipv6 jpeg libg++ libwww mad mhash mikmod motif mp3 mpeg ncurses nls ogg oggvorbis opengl pam pcre pdflib perl php png python qt quicktime readline sdl spell ssl tcpd truetype truetype-fonts type1-fonts udev unicode vorbis xml2 xmms xv zlib userland_GNU kernel_linux elibc_glibc" Unset: ASFLAGS, CTARGET, LANG, LC_ALL, LDFLAGS, LINGUAS, MAKEOPTS, PORTDIR_OVERLAY
So put fastcgi into your use flags... Portage won't handle such things for you.