copy & paste ได้เลยครับ
rpm -Uvh http://pkgs.repoforge.org/rpmforge-release/rpmforge-release-0.5.2-2.el6.rf.x86_64.rpm
yum update -y
yum install nano wget gcc gcc-c++ make mysql mysql-server mysql-devel mysql-libs libxml2-devel openssl-devel bzip2-devel libcurl-devel libjpeg-devel libpng-devel freetype-devel libmcrypt-devel libxslt-devel
wget http://th.php.net/get/php-5.4.0.tar.gz/from/this/mirror
tar xf php-5.4.0.tar.gz
cd php-5.4.0
./configure --with-openssl --with-zlib --enable-bcmath --with-bz2 --enable-calendar --with-curl --with-curlwrappers --enable-dba --enable-exif --enable-ftp --with-gd --enable-gd-native-ttf --enable-gd-jis-conv --enable-mbstring --with-mcrypt --with-mhash --with-mysqli=mysqlnd --with-pdo-mysql=mysqlnd --with-mysql=mysqlnd --enable-shmop --with-snmp --enable-soap --enable-sockets --with-regex --enable-wddx --with-xmlrpc --with-iconv --with-xsl --enable-zip --with-jpeg-dir=/usr/lib64 --with-freetype-dir=/usr/lib64 --libdir=/usr/lib64 --enable-fpm
make
make install
cp php.ini-production /usr/lib64/php.ini
โดยตัว binary ของ php ต่างๆ จะอยู่ที่
- php => /usr/local/bin/php
- php-cgi => /usr/local/bin/php-cgi
- php-fpm => /usr/local/sbin/php-fpm