CentOS 6.7にPHPをソースインストールする
先に、Apache2とMySQLをソースインストールしておきます。
コンパイルに必要なヘッダーファイルをイストールします。
$ sudo yum -y install libxml2-devel libjpeg-devel libpng-devel
PHP公式サイトより、.tar.gzファイルの最新版をダウンロードし、適当なディレクトリに置きます。
$ tar xvzf ~/jdrive/src/php-5.6.17.tar.gz $ cd php-5.6.17 $ sudo ./configure --with-apxs2=/usr/local/apache/bin/apxs \ --enable-mbstring --with-mysql=/usr/local/mysql \ --with-pdo-mysql=/usr/local/mysql --enable-libxml \ --enable-xml --with-gd --enable-gd-native-ttf --with-pear --enable-bcmath \ --with-jpeg-dir --with-png-dir --with-zlib-dir --with-config-file-path=/etc $ sudo make $ sudo make test $ sudo make install