Installing Apache 2.x and PHP5

Installing Apache 2.x

./configure \
--prefix=/usr/local/apache \
--enable-info \
--enable-rewrite \
--enable-ssl \
--enable-unique-id \
--enable-deflate \
--enable-usertrack \
--enable-so

make
make install


cp build/rpm/httpd.init /etc/init.d/httpd
chkconfig --add httpd
chkconfig --level 3456 httpd on

Installing PHP required Libraries
http://www.ijg.org/files/jpegsrc.v6b.tar.gz
./configure --enable-shared
mkdir -p /usr/local/man/man1
make
make install

http://www.libpng.org/pub/png/libpng.html
./configure
make
make install

http://voxel.dl.sourceforge.net/sourceforge/freetype/freetype-2.1.9.tar.gz
./configure
make
make test
make install

Install LibMCrypt
http://sourceforge.net/projects/mcrypt
./configure
make
make install

Installing PHP5

./configure \
--with-apxs2=/usr/local/apache/bin/apxs \
--with-openssl \
--with-gd \
--with-jpeg-dir \
--with-png-dir \
--with-zlib-dir \
--with-freetype-dir \
--with-ttf \
--with-mysql=/usr/local/mysql \
--with-mysqli=/usr/local/mysql/bin/mysql_config \
--with-mcrypt \
--enable-mbstring \
--enable-bcmath

make
make install

Configuring Apache for PHP
vi /usr/local/apache/conf/httpd.conf

add
AddType application/x-httpd-php .php

change
DirectoryIndex index.php index.html index.html.var

php.ini
copy php.ini-development or php.ini-production to /usr/local/lib/php.ini

edit /usr/local/lib/php.ini
timezone = Asia/HongKong

Leave a Reply