「PHP5のインストール」の版間の差分

提供: Wikiducca
移動: 案内検索
(configure オプション)
 
(1版)
(相違点なし)

2011年10月14日 (金) 02:15時点における版

CentOS5系 & Apache2.2系 & ソースからコンパイル の手順。


あらかじめ入れておくもの

  • libtool
  • libtool-ltdl
  • libtool-ltdl-devel
  • libmcrypt
  • libmcrypt-devel
  • libpng
  • libpng-devel

ダウンロード

http://jp.php.net/get/php-5.3.2.tar.gz/from/a/mirror この辺から拾ってくる。


configure オプション

./configure --with-apxs2=/usr/local/apache2/bin/apxs \
--enable-mbstring \
--with-gd \
--enable-gd-native-ttf \
--with-png-dir=/usr \
--with-zlib \
--with-jpeg-dir=/usr \
--enable-ftp \
--with-mysql \
--enable-soap \
--with-libdir=lib64 \
--with-mcrypt \
--with-curl \
--with-openssl

それぞれの意味は以下を参照。

http://php.net/manual/ja/configure.about.php

make & make install

# make 
# make test (必須ではない)
# make install


php.iniのコピー

※先にRPM 版の /etc/php.ini が残っていたら、削除 or リネームしておくこと。

# cp php.ini-production /usr/local/lib/php.ini


php.iniの編集

date.timezone = Asia/Tokyo

を設定する。


httpd.conf に以下を追記

LoadModule php5_module       modules/libphp5.so


対象となるディレクトリに以下を追記

AddType application/x-httpd-php .php
DirectoryIndex index.php index.html index.htm


以上で、Apache を再起動すれば、PHP が使えるようになっている。はず。