.. index:: php_5.4.29 .. meta:: :noindex: robots PHP 5.4.29 ============= .. warning:: このコンテンツは古くなりました。手順通り実施してもインストールできない可能性があります。 .. contents:: Contents =========== 実行環境 =========== :ref:`centos_6.3` =========== 最終検証日 =========== 2014/05/30 =========== 依存関係 =========== =========== コンパイル =========== .. note:: 基本的に管理者権限ユーザ(rootなど)で作業されることを前提としています .. code-block:: bash BASE=/opt/brew export PATH=${BASE}/bin:${PATH} export PYTHONPATH=${BASE}/seo export LD_LIBRARY_PATH=${BASE}/lib export LDFLAGS=-L${BASE}/lib export LD_RUN_PATH=${BASE}/lib # make base directory rm -rf ${BASE}/{bin,lib} mkdir -p ${BASE}/{bin,lib} # ソースダウンロード先 comp_dir=/usr/local/src # パッケージ名 pack_name=httpd # バージョン version=-5.4.29 # ソースのファイル形式 ext=.tar.bz2 # tar解凍時のオプション ext_opt=j # インストール先ディレクトリ ins_dir=/opt/${pack_name}/${version##-} # ダウンロード元パッケージ dl_uri="http://jp1.php.net/get/php-5.4.29.tar.bz2/from/this/mirror" cd ${comp_dir} rm -rf ${pack_name}${version} test -f ${pack_name}${version}${ext} \ || wget ${dl_uri} -O ${pack_name}${version}${ext} tar ${ext_opt}xf ${pack_name}${version}${ext} cd ${pack_name}${version} ./configure \ --prefix=${ins_dir} \ --enable-mbstring \ && make \ && make install ================ Pathの設定 ================ .. code-block:: bash for i in ${ins_dir}/bin/* do echo "ln -fs ${i} ${BASE}/bin/${i##*/}" ln -fs ${i} ${BASE}/bin/${i##*/} done export PATH=${ins_dir}/bin:${PATH} ======================== 主なconfigureオプション ======================== ``--prefix=[DIR]`` インストール先ディレクトリの指定 ``--with-libxml-dir=[DIR]`` libxml2のインストールディレクトリを指定 DOMやxmlパーサに必要 インストールしない場合かなりの機能を制限されます ``--with-apxs2[=DIR]`` Apache2.x系と連携するためのモジュールをコンパイルします デフォルトは/usr/local/apache ex.) --with-apxs2=/path/to/apxs ``--with-mysql[=DIR]`` MySQLと連携する場合は必須 ``--enable-fpm`` nginxと連携させる場合に必要 ``--with-curl=[DIR]`` cURLを使用する場合に指定が必要 =========== Apache連携 =========== | configureのオプションに ``--with-apxs2[=DIR]`` を付けてコンパイルします。 | 既にhttpd.confにはphpのモジュールを読み込むように設定されていますので、拡張子とPHPの実行を結びつけます。 .. code-block:: text AddHandler application/x-httpd-php .php