akkun_choi pedia
mindiaakkun_choi pedia見出し語

PHPをソースからインストール

akkun_choi · 2009-09-08 更新 · 1 ポイント

必要なモジュールを入れる(なかったらconfigureかmakeでないよって言われる)

$ sudo yum install httpd-devel flex libxml2-devel \
libpng-devel mysql-devel libjpeg-devel libmcrypt-devel

こんな感じで

$ ./configure \ 
        --prefix=/usr/local/php-5.2.10 \
        --with-apxs2=/usr/sbin/apxs \
        --enable-cli \
        --with-gd \
        --with-jpeg-dir=/usr/local \
        --with-png-dir=/usr/local \
        --with-gd \
        --with-zlib \
        --with-zlib-dir=/usr/local \
        --with-openssl \
        --with-config-file-path=/etc \
        --with-libmbfl \
        --with-mcrypt \
        --with-mime-magic \
        --with-mysql \
        --enable-pcntl \
        --enable-zend-multibyte \
        --enable-mbstring \
        --enable-gd-native-ttf \
        --enable-gd-jis-conv \
        --enable-exif \
        --enable-pdo \
        --with-pdo-sqlite \
        --with-pdo-mysql \
        --with-pear

参考:
中心となる configure オプションのリスト
http://php.he.net/manual/ja/configure.about.php
PHPのconfigure
http://d.hatena.ne.jp/vector_xenon/20090224/1235550869

あとはmake, make installするだけだけど、パッケージ管理してるのでそのままinstallはしません!
RPMから入れます。

RPM作成する

rootではやらない方がいいとのこと。
一般ユーザでやるため、出力ディレクトリの設定する。

~/.rpmmacrosに

%_topdir $HOME/rpm

$ mkdir -p ~/rpm/{BUILD,RPMS,SOURCES,SPECS,SRPMS}

PHPにはmakerpmというスクリプトがついてくる。

で実行するとRPM作成できる。

参考
http://blog.rakugaki.jp/archives/20081222,35.html
http://www.atmarkit.co.jp/flinux/rensai/linuxtips/530mkrpmfs.html
http://www.stackasterisk.jp/tech/systemManagement/rpm01_01.jsp

rpm作成できたけど、phpizeに合わせる設定がめんどくさい!
結局某所のRPMで入れました。

まぁでもRPMの仕組みとかなんか色々勉強になった。

関連する見出し語