PHP

PHP5.3.8をCentOS6でbuildconfしたらすんなりいかなかった件

PHP5.3.8をCentOS6(GMOクラウドの仮想サーバ)でをPECL拡張を入れるため自前コンパイルしようとbuildconfしたらすんなり行かなかったので、ちょこっとメモ。

必要な物なライブラリなどはyumで入れてある前提。

# mkdir ~/src
# cd src
# wget http://jp2.php.net/get/php-5.3.8.tar.bz2/from/this/mirror
# tar -xjf php-5.3.8.tar.bz2
# cd php-5.3.8

<省略>(PECL拡張モジュールの導入)

# ./buildconf --force
Forcing buildconf
buildconf: checking installation...
buildconf: You need autoconf 2.59 or lower to build this version of PHP.
           You are currently trying to use 2.63
           Most distros have separate autoconf 2.13 or 2.59 packages.
           On Debian/Ubuntu both autoconf2.13 and autoconf2.59 packages exist.
           Install autoconf2.13 and set the PHP_AUTOCONF env var to
           autoconf2.13 and try again.
make: *** [buildmk.stamp] Error 1

てな具合にautoconfのバージョン新しすぎという警告が出ます。
仕方ないので、古いバージョンを落としてきてコンパイル。

# wget http://ftp.gnu.org/gnu/autoconf/autoconf-2.59.tar.gz
# tar zxf autoconf-2.59.tar.gz
# cd autoconf-2.59
# ./configure --prefix=/root/autoconf && make && make install
# export PHP_AUTOCONF=/root/autoconf/bin/autoconf

そしたらbuildconfしてconfigure。以下のようなオプションにしました。

# ./buildconf --force
# CFLAGS="-O3 -fomit-frame-pointer" \
# CXXFLAGS="-O3 -fomit-frame-pointer" \
# ./configure \
--prefix=/usr/local \
--disable-ipv6 \
--with-curl \
--enable-exif \
--disable-fileinfo \
--disable-filter \
--enable-ftp \
--with-gd \
--with-jpeg-dir \
--with-png-dir \
--with-zlib-dir \
--with-xpm-dir \
--with-freetype-dir \
--with-t1lib \
--enable-gd-native-ttf \
--enable-gd-jis-conv \
--enable-mbstring \
--with-mcrypt \
--with-mysql=mysqlnd \
--with-mysql-sock=/mtmp/mysql.sock \
--with-pdo-mysql=mysqlnd \
--with-openssl \
--disable-phar \
--disable-posix \
--with-readline \
--disable-simplexml \
--enable-soap \
--enable-sockets \
--without-sqlite \
--disable-tokenizer \
--disable-xmlreader \
--disable-xmlwriter \
--enable-zip \
--enable-memcached \
--with-libmemcached-dir=/usr/local \
--with-imagick=/usr \
--enable-xcache \
--enable-xcache-constant \
--enable-xcache-coverager \
--enable-fpm \
--with-fpm-user=php \
--with-fpm-group=php \
--enable-zend-multibyte
...
configure: error: libXpm.(a|so) not found.

なんかlibXpmが行方不明らしい。
64bit版OS使ってるので上記のオプションに加えlib64ディレクトリを指定してやります。

# ./configure
...
--with-libdir=lib64

以上。めでたし。

スポンサーリンク
管理人

システムえんじにゃー🐈
趣味はエレキギターなど。作曲したい。
WoWs/プリコネ
記事に関する質問はお気軽にどうぞ。

surface0 (さーふぇす)をフォローする
surface0 (さーふぇす)をフォローする

コメント

タイトルとURLをコピーしました