yum install -y gcc gcc-c++ make automake autoconf patch curl-devel libmcrypt-devel mhash-devel gd-devel libjpeg-devel libpng-devel libXpm-devel libxml2-devel libxslt-devel openssl-devel recode-devel
useradd www
rpm -e --nodeps mysql-libs
yum localinstall MySQL-*
tar zxvf libiconv-1.14.tar.gz
cd libiconv-1.14
./configure --prefix=/usr
make && make install
cd ../
tar xf libmcrypt-2.5.8.tar.gz
cd libmcrypt-2.5.8
./configure
make && make install
cd ../
tar xf mhash-0.9.9.9.tar.gz
cd mhash-0.9.9.9
./configure
make && make install
cd ../
tar xf mcrypt-2.6.8.tar.gz
cd mcrypt-2.6.8
./configure
make && make install
cd ../
tar xf php-5.3.25.tar.gz
cd php-5.3.25
./configure --prefix=/srv/php-5.3.25 \--with-config-file-path=/srv/php-5.3.25/etc \--with-config-file-scan-dir=/srv/php-5.3.25/etc/conf.d \--enable-fpm \--with-fpm-user=www \--with-fpm-group=www \--with-pear \--with-curl \--with-gd \--with-jpeg-dir \--with-png-dir \--with-freetype-dir \--with-zlib-dir \--with-iconv \--with-mcrypt \--with-mhash \--with-mysql \--with-mysqli=/usr/bin/mysql_config \--with-pdo-mysql \--with-mysql-sock=/var/lib/mysql/mysql.sock \--with-openssl \--with-xsl \--with-recode \--enable-sockets \--enable-soap \--enable-mbstring \--enable-gd-native-ttf \--enable-zip \--enable-xml \--enable-bcmath \--enable-calendar \--enable-shmop \--enable-dba \--enable-wddx \--enable-sysvsem \--enable-sysvshm \--enable-sysvmsg \--enable-pcntl \--with-tsrm-pthreads \--disable-debug
./configure --prefix=/srv/php-5.3.25 \
--with-config-file-path=/srv/php-5.3.25/etc \
--with-config-file-scan-dir=/srv/php-5.3.25/etc/conf.d \
--enable-fpm \
--with-fpm-user=www \
--with-fpm-group=www \
--with-libdir=lib64 \
--with-pear \
--with-curl \
--with-gd \
--with-jpeg-dir \
--with-png-dir \
--with-freetype-dir \
--with-zlib-dir \
--with-iconv \
--with-mcrypt \
--with-mhash \
--with-mysql \
--with-mysqli=/usr/bin/mysql_config \
--with-pdo-mysql \
--with-mysql-sock=/var/lib/mysql/mysql.sock \
--with-openssl \
--with-xsl \
--with-recode \
--enable-sockets \
--enable-soap \
--enable-mbstring \
--enable-gd-native-ttf \
--enable-zip \
--enable-xml \
--enable-bcmath \
--enable-calendar \
--enable-shmop \
--enable-dba \
--enable-wddx \
--enable-sysvsem \
--enable-sysvshm \
--enable-sysvmsg \
--enable-pcntl \
--with-tsrm-pthreads \
--disable-debug
make && make install
mkdir -p /srv/php-5.3.25/etc/conf.d
cp /usr/local/src/php-5.3.25/php.ini-* /srv/php-5.3.25/etc/
cp /usr/local/src/php-5.3.25/sapi/fpm/init.d.php-fpm /etc/init.d/php-fpm
chmod +x /etc/init.d/php-fpm
cp /srv/php-5.3.25/etc/pear.conf{,.original}
cp /srv/php-5.3.25/etc/php-fpm.conf.default /srv/php-5.3.25/etc/php-fpm.conf
vim /srv/php-5.3.25/etc/php-fpm.conf <<end > /dev/null 2>&1
:25,25s/;//
:32,32s/;//
:217,217s/pm.max_children = 5/pm.max_children = 256/
:243,243s/;pm.max_requests = 500/pm.max_requests = 1024/
:440,440s/;rlimit_files = 1024/rlimit_files = 10240/
:wq
end
cp /srv/php-5.3.25/etc/php.ini-production /srv/php-5.3.25/etc/php.ini
vim /srv/php-5.3.25/etc/php.ini <<EOF > /dev/null 2>&1
:435,435s#expose_php = On#expose_php = Off#
:465,465s/memory_limit = 128M/memory_limit = 16M/
:854,854s/;cgi.fix_pathinfo=1/cgi.fix_pathinfo=0/
:891,891s/upload_max_filesize = 2M/upload_max_filesize = 8M/
:1008,1008s#;date.timezone =#date.timezone = Asia/Hong_Kong#
:1490,1490s:;session.save_path = "/tmp":session.save_path = "/dev/shm":
:1508,1508s/session.name = PHPSESSID/session.name = JSESSIONID/
:wq
EOF
cp /srv/php-5.3.25/etc/pear.conf{,.original}
cp /srv/php-5.3.25/etc/php-fpm.conf.default /srv/php-5.3.25/etc/php-fpm.conf
ln -s /srv/php-5.3.25/ /srv/php
cd /ext/soap
/srv/php-5.3.25/bin/phpize
./configure --with-php-config=/srv/php-5.3.25/bin/php-config --enable-soap
make && make install
ln -s /srv/php-5.3.25/lib/php/extensions/no-debug-non-zts-20090626/soap.so /srv/php-5.3.25/lib/php/extensions/
cat > /srv/php-5.3.25/etc/conf.d/soap.ini <<EOF
extension=soap.so
EOF
/srv/php-5.3.25/lib/php/extensions/no-debug-non-zts-20090626/
wget http://pecl.php.net/get/APC-3.1.13.tgz
tar xf APC-3.1.13.tgz
cd APC-3.1.13
/srv/php-5.3.25/bin/phpize
./configure --enable-apc --enable-apc-mmap --with-php-config=/srv/php-5.3.25/bin/php-config
make && make install
ln -s /srv/php-5.3.25/lib/php/extensions/no-debug-non-zts-20090626/apc.so /srv/php-5.3.25/lib/php/extensions/
cat > /srv/php-5.3.25/etc/conf.d/apc.ini <<EOF
extension=apc.so
EOF