PHP 5 インストール Linux

投稿者:

PHP 5の基本的なインストールです
Red Hat 9 ではコンパイル時にlibxml2のバージョンが古いというエラーがでたのでアップグレード
ftp://xmlsoft.org/libxml2/ で最新版を入手可能する
[root@localhost src]# chmod +x *.rpm
[root@localhost src]# rpm -Uvh libxml2-*
警告: libxml2-2.6.11-1.i386.rpm: V3 DSA signature: NOKEY, key ID de95bc1f
Preparing… ########################################### [100%]
1:libxml2 ########################################### [ 33%]
2:libxml2-devel ########################################### [ 67%]
3:libxml2-python ########################################### [100%]
tar xvzf php-5.1.4.tar.gz
cd php-5.1.4
./configure –with-apxs2=/usr/local/apache2/bin/apxs –enable-magic-quotes –with-xml –enable-mbregex –enable-mbstring –enable-zend-multibyte –with-mysql=/usr/local/mysql –with-pgsql=/usr/local/pgsql7.4.8 –enable-pear –with-zlib –with-gd –with-gettext –with-jpeg-dir=/usr/lib –with-png-dir=/usr/lib
make
make install
httpd.conf 記述確認
AddType application/x-httpd-php .php
LoadModule php5_module modules/libphp5.so
  *おそらく自動的に追加されるはず
iniファイル作成
cp php.ini-dist /usr/local/lib/php.ini
変更箇所
mbstring.language = Japanese
mbstring.internal_encoding = EUC-JP
mbstring.http_input = auto
mbstring.http_output = Shift_JIS
mbstring.encoding_translation = On
mbstring.detect_order = auto
mbstring.substitute_character = none
Apacheを再起動する
info.phpを作成してアクセスできればOK
PHP 5からPearが最初から組み込まれてるのがいいですね~

Thank you for reading this post, don't forget to subscribe!