itheart.com
   phpGroupWare  |   地域ITサポート  |   ITはあとについて          Web全体 このサイト内   







PHP4 をインストールします。

0. インストール前の準備

PHP を rpm でインストールしている場合は、アンインストールをお勧めします


PHPのインストールは、以下の手順で行います。

1. PHP のソースファイルを /usr/local/src へ展開

$ su - root
Password:
# cd /usr/local/src
# tar xzvf php-4.3.9.tar.gz
#


2. PHP を展開したディレクトリに移動し、configure スクリプトを実行

※PostgreSQL 選択時
# cd php-4.3.9
# ./configure --with-apxs2=/usr/local/apache2/bin/apxs --with-pgsql=/usr/local/pgsql --without-mysql \
--with-imap=../imap-2004 --with-imap-ssl=/usr/share/ssl
#


※MySQL 選択時
# cd php-4.3.9
# ./configure --with-apxs2=/usr/local/apache2/bin/apxs --with-mysql=/usr/local/mysql --without-pgsql \
--with-imap=../imap-2004 --with-imap-ssl=/usr/share/ssl
#


3. PHPのコンパイルとインストール

# make
# make install
#

※/usr/local にインストールします。


4. php の環境設定 (php.ini)

# cp php.ini-dist /usr/local/lib/php.ini
# cd /usr/local/lib
# vi php.ini

次の各オプションを変更してください。

output_buffering = Off
magic_quotes_gpc = Off
default_charset = EUC-JP
mbstring.language = Japanese
mbstring.internal_encoding = EUC-JP
mbstring.http_input = auto
mbstring.http_output = EUC-JP
mbstring.encoding_translation = On
mbstring.detect_order = auto
mbstring.substitute_character = none


5. Apache の環境設定 (httpd.conf)

# cd /usr/local/apache2/conf
# vi httpd.conf

DirectoryIndex,AddType をご自身の環境に合わせて変更してください。

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


6. Apache を起動

# cd /etc/rc.d/init.d
# ./httpd2 start
# logout
$


ITはあと

E-Mail:your@itheart.com

TEL:0776-67-5502

FAX:0776-67-5602