CentOs 6.5ソースコードコンパイルインストールPHP 5.6

1189 ワード

まずphp拡張依存パッケージをインストールします(不要な場合もありますが、自分で選別できます)
yum -y install mhash-devel libmcrypt-devel libxslt-devel libjpeg libjpeg-devel libpng libpng-devel freetype freetype-devel libxml2 libxml2-devel zlib zlib-devel glibc glibc-devel glib2 glib2-devel bzip2 bzip2-devel ncurses ncurses-devel curl curl-devel e2fsprogs e2fsprogs-devel krb5 krb5-devel libidn libidn-devel openssl openssl-devel

そして、PHPインストール前の構成を実行する
./configure \
--prefix=/usr/local/php \
--with-config-file-path=/usr/local/php/etc \
--with-bz2 \
--with-curl \
--enable-ftp \
--enable-sockets \
--disable-ipv6 \
--with-gd \
--with-jpeg-dir=/usr/local \
--with-png-dir=/usr/local \
--with-freetype-dir=/usr/local \
--enable-gd-native-ttf \
--with-iconv-dir=/usr/local \
--enable-mbstring \
--enable-calendar \
--with-gettext \
--with-libxml-dir=/usr/local \
--with-zlib \
--with-pdo-mysql=mysqlnd \
--with-mysqli=mysqlnd \
--with-mysql=mysqlnd \
--enable-dom \
--enable-xml \
--with-libdir=lib64 \
--enable-pdo \
--enable-fpm \
--disable-fileinfo

最後に、インストール操作をコンパイルして実行する
make && make install

PHPのインストール後に配置する必要があります.具体的な配置は後述の文章でまとめます.