CentOSにPHP5.5.28をインストール

1.PHPの拡張モジュールをインストール
yum install gcc
yum install libxml2-devel curl-devel libjpeg libjpeg-devel libpng-devel freetype-devel.x86_64 mysql-devel
yum install freetype-devel.x86_64 freetype.x86_64
yum install libjpeg libjpeg-devel

2.PHPをダウンロードしてインストール
wget http://us1.php.net/distributions/php-5.3.28.tar.bz2
tar -jxf php-5.3.28.tar.bz2
cd php-5.3.28
./configure –prefix=/usr/local/php-5.3.28 –enable-fpm –with-mysql –with-zlib –with-config-file-path=/usr/local/php5.3.28/etc –with-pdo-mysql –with-libdir=lib64 –with-gd –with-jpeg-dir=/usr/lib –with-png-dir=/usr/lib –enable-mbstring –enable-gd-native-ttf –enable-xml –with-freetype-dir –with-curl –enable-ftp –enable-zip –with-mcrypt –enable-mbstring –enable-json
3.libmcryptモジュールのインストール

エラーメッセージ:

checking for alloca… (cached) yes
checking for 8-bit clean memcmp… yes
checking for stdarg.h… (cached) yes
checking for mcrypt support… yes
configure: error: mcrypt.h not found. Please reinstall libmcrypt
rpm -qa | grep libmcrypt
libmcrypt-2.5.7-5.el5
libmcrypt-2.5.8-4.el5.centos

解決対策:
wget ftp://mcrypt.hellug.gr/pub/crypto/mcrypt/attic/libmcrypt/libmcrypt-2.5.7.tar.gz 安装:
tar -zxvf libmcrypt-2.5.7.tar.gz
cd libmcrypt-2.5.7
./configure
make
make install

PHP

Posted by arkgame