1. Install Optional Package
yum -y install zlib zlib-devel pcre pcre-devel
Solutions to some configure errors:
configure: error: C compiler cannot create executables
apt-get install libc6-dev.
configure: error: configure: error: pcre-config not foundapt-get install libpcre3-dev
configure: error: zlib-headers and/or libs where not found
apt-get install zlib1g-dev
configure: error: bzip2-headers and/or libs where not found
apt-get install libbz2-dev
configure: error: bzip2-headers and/or libs where not found, install them or build with --without-bzip2
yum -y install bzip2 bzip2-devel
2. Install Spawn-fcgi
wget http://www.lighttpd.net/download/spawn-fcgi-1.6.3.tar.bz2
./configure --prefix=/usr/local/spawn-fcgi
make
make install
3. Install Lighttpdwget http://download.lighttpd.net/lighttpd/releases-1.4.x/lighttpd-1.4.26.tar.bz2
tar xjf lighttpd-1.4.26.tar.bz2
cd lighttpd-1.4.26
./configure --prefix=/usr/local/lighttpd --sysconfdir=/etc/lighttpd
make
make install
mkdir /etc/lighttpd
cp doc/lighttpd.conf /etc/lighttpd/
cp doc/rc.lighttpd.redhat /etc/init.d/lighttpd
mkdir /var/log/lighttpd
mkdir /usr/local/lighttpd/bin/
cp ./doc/spawn-php.sh /usr/local/lighttpd/bin/
chown -R lighttpd:lighttpd /usr/local/lighttpd
groupadd lighttpd
useradd -g lighttpd -s /sbin/nologin -d /dev/null lighttpd
4. Install PHP./configure \
--prefix=/usr/local/php-fcgi \
--enable-fastcgi \
--enable-force-cgi-redirect \
--enable-inline-optimization \
--with-config-file-path=/etc \
--enable-calendar \
--enable-bcmath \
--enable-calendar \
--enable-exif \
--enable-ftp \
--enable-gd-native-ttf \
--enable-libxml \
--enable-magic-quotes \
--enable-mbstring \
--enable-soap \
--enable-sockets \
--enable-wddx \
--enable-zip \
--enable-sqlite-utf8 \
--with-freetype-dir=/usr \
--with-gd \
--with-gettext \
--with-jpeg-dir=/usr \
--with-libxml-dir=/usr \
--with-mysql=/usr/local/mysql \
--with-mysql-sock=/tmp/mysql.sock \
--with-mysqli=/usr/local/mysql/bin/mysql_config \
--with-openssl=/usr \
--with-openssl-dir=/usr \
--with-png-dir=/usr \
--with-xmlrpc \
--with-xpm-dir=/usr/X11R6 \
--with-zlib \
--with-zlib-dir=/usr \
--with-pdo-mysql=/usr/local/mysql \
--with-curl
make
make install
cp php.ini-recommended /etc/php.ini
ln -s /usr/local/php-fcgi/bin/php-cgi /usr/bin/php
5. Configvi /usr/local/lighttpd/bin/spawn-php.sh
SPAWNFCGI="/usr/local/spawn-fcgi/bin/spawn-fcgi"
FCGIPROGRAM="/usr/local/php-fcgi/bin/php"
USERID=lighttpd
GROUPID=lighttpd
ln -s /usr/local/lighttpd/sbin/lighttpd /usr/sbin/lighttpd
/etc/init.d/lighttpd start