CentOS4.4 + Apache 2.2 + PHP5.3

CentOS4.4 で Apache 2.2 + PHP5.3 のインストールをしてみました。公開用ではないのでコンパイルして起動できればいいや、という程度なので、そのつもりでみてください。

いまどき、ソースからインストールする人は少ないのだろうなぁと思いますが… (64bit環境では --with-libdir=lib64 )とつけるとよいらしい。

# cd /usr/local/src/
# sudo wget http://ftp.riken.jp/net/apache/httpd/httpd-2.2.16.tar.gz
# sudo wget http://jp.php.net/distributions/php-5.3.2.tar.gz
# sudo tar xzf httpd-2.2.16.tar.gz 
# cd httpd-2.2.16
# sudo ./configure --prefix=/usr/local/apache2 --enable-module=so
# sudo make
# sudo su -
# cd /usr/local/src/httpd-2.2.16
# make install | tee > install.log
# yum install flex
# yum install libtool libtool-libs
# yum install libxml2-devel libxml2
# yum install libjpeg libjpeg-devel
# yum install libpng-devel libpng
# yum install freetype freetype-devel
# yum install mysql-devel
# cd php-5.3.2
# ./configure --prefix=/usr/local/php-5.3.2 \
 --with-apxs2=/usr/local/apache2/bin/apxs \
 --enable-mbstring --enable-mbregex \
 --enable-sockets --with-mhash \
 --with-openssl=/usr \
 --with-mysql \
 --with-pdo-mysql \
 --with-mcrypt \
 --enable-zend-multibyte --disable-cgi --enable-inline-optimization \
 --enable-sigchild --enable-exif --enable-ftp \
 --with-gd --with-zlib-dir=/usr/lib \
 --with-jpeg-dir=/usr/lib --with-png-dir=/usr/lib \
 --with-freetype-dir=/usr/lib
# make
# make install 2>&1 | tee ../php-5.3.2.make-install.log
# cp /usr/local/src/php-5.3.2/php.ini-production /usr/local/php-5.3.2/lib/php.ini

最後にphp.iniを編集しています。変更分だけ書いておきます。

# php.ini
extension_dir = "/usr/local/php-5.3.2/ext"
include_path = ".:/usr/local/php-5.3.2/includes"
mbstring.language = Japanese
mbstring.internal_encoding = UTF-8
mbstring.http_output = UTF-8

apacheの設定ファイルでは、Listenでポート番号を指定して、user, group を適切な(apacheとか、wwwとか)ものを指定しました。

同じタグの記事: Apache
同じタグの記事: CentOS
同じタグの記事: PHP
同じカテゴリの記事: Linux
関連書籍: Apache
関連書籍: CentOS
関連書籍: PHP