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

1pt

必要なモジュールを入れる(なかったら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というスクリプトがついてくる。

  • ./configureは書き換え
  • CGI関係は全部コメントアウト
  • 最後のrpmをrpmbuildに変更
  • Copyright -> License
  • ベースディレクトリを変更

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

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

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

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

「PHPをソースからインストール」について友人に書いてもらう。

あなたにとって「PHPをソースからインストール」とは?

ログインするとワンクリックでキーワードを投稿できます

ログインする 新規登録する

関連したキーワードを持つお気に入り

他の人の「PHPをソースからインストール」を見る