*PHP 5.0 インストール手順 [#gfd0d8fe]
#contents
**概要 [#k9fbc4a4]
本手順書は下記環境に沿ったインストール手順である。

PHP    : php 5.1.6~
OS     : Redhat Enterprise Linux ESv4 (x86 32bit)~
インストール先 : /usr/local/php

**ソースの取得 [#j1257763]
開発元のサイトよりインストール元を取得する。~

http://jp.php.net/

**インストール [#x0cc538d]
ソースを取得し展開する

 cd /usr/local/src
 wget http://jp.php.net/get/php-5.2.4.tar.gz/from/this/mirror
 tar xfvz php-5.2.4.tar.gz
 cd php-5.2.4

configureを行う。~
各種ライブラリを指定した設定。

 ./configure --prefix=/usr/local/php --with-apxs2=/usr/local/apache/bin/apxs --enable-mbstring --enable-mbregex --enable-zend-multibyte --with-gd --enable-gd-native-ttf --with-freetype-dir=/usr --with-png-dir=/usr --with-jpeg-dir=/usr --with-zlib --with-openssl
 ./configure --prefix=/usr/local/php --with-apxs2=/usr/local/apache/bin/apxs --enable-mbstring --enable-mbregex --enable-zend-multibyte --with-gd --enable-gd-native-ttf --enable-bcmath --with-freetype-dir=/usr --with-png-dir=/usr --with-jpeg-dir=/usr --with-zlib --with-openssl

各種ライブラリの指定とMySQLサポートを追加した設定。

 ./configure --prefix=/usr/local/php --with-apxs2=/usr/local/apache/bin/apxs --enable-mbstring --enable-mbregex --enable-zend-multibyte --with-gd --enable-gd-native-ttf --with-freetype-dir=/usr --with-png-dir=/usr --with-jpeg-dir=/usr --with-zlib --with-openssl --with-mysql=/usr/local/mysql
 ./configure --prefix=/usr/local/php --with-apxs2=/usr/local/apache/bin/apxs --enable-mbstring --enable-mbregex --enable-zend-multibyte --with-gd --enable-gd-native-ttf --enable-bcmath --with-freetype-dir=/usr --with-png-dir=/usr --with-jpeg-dir=/usr --with-zlib --with-openssl --with-mysql=/usr/local/mysql

sambaのインストールなどでiconvが変更されている場合は以下のオプションを追加する。

 --with-iconv=/usr/local/lib


コンパイルとインストールを行う。~

 make
 make install

**設定ファイル作成 [#zd881ba2]
ソースphp.iniを所定位置に配置する。

 cd /usr/local/src/php-5.1.6
 cp php.ini-dist /usr/local/php/lib/php.ini

**httpd.confへの追記 [#x6485cda]
モジュールの読み込み設定は自動的に行われるがAddTypeは行われないため、手動で追記する必要がある。
 AddType application/x-httpd-php .php

**apacheの起動時にエラーが出る場合 [#qbbd13ae]
SE Linuxが有効になっている場合は以下のエラーが発生する。

 libphp5.so: cannot restore segment prot after reloc
 
これはモジュールの権限に起因する問題であるため、権限の振りなおしかSE Linuxの停止で回避できる

トップ   編集 差分 バックアップ 添付 複製 名前変更 リロード   新規 一覧 検索 最終更新   ヘルプ   最終更新のRSS