yum update
yum groupinstall 'Development Tools'
yum install -y gcc gcc-c++ gcc-g77 autoconf automake zlib* fiex* libxml* ncurses-devel libmcrypt* libtool-ltdl-devel*
mkdir /data/soft -p
cd data/soft/
scp [email protected]:/data/soft/* ./
tar zxvf libmcrypt-2.5.8.tar.gz
cd libmcrypt-2.5.8
./configure
make
make install
cd ..
tar zxvf tiff-4.0.8.tar.gz
cd tiff-4.0.8
./configure --prefix=/usr/local/tiff --enable-shared
make
make install
cd ..
tar xvf libpng-1.6.16.tar
cd libpng-1.6.16
./configure --prefix=/usr/local/libpng --enable-shared
make
make install
cd ..
tar zxvf freetype-2.5.5.tar.gz
cd freetype-2.5.5
./configure --prefix=/usr/local/freetype --enable-shared
make
make install
cd ..
tar zxvf jpegsrc.v9a.tar.gz
cd jpeg-9a/
./configure --prefix=/usr/local/jpeg --enable-shared
make
make install
cd ..
tar zxvf libgd-2.1.0.tar.gz
cd libgd-2.1.0
yum -y install libXpm-devel
yum -y install libvpx-devel
yum -y install fontconfig*
./configure --prefix=/usr/local/libgd --enable-shared --with-jpeg=/usr/local/jpeg --with-png=/usr/local/libpng --with-freetype=/usr/local/freetype --with- fontconfig --with-xpm=/usr/ --with-tiff=/usr/local/tiff --with-vpx=/usr/local/libvpx
make
make install
cd ..
tar zxvf t1lib-5.1.2.tar.gz
cd t1lib-5.1.2
./configure --prefix=/usr/local/t1lib --enable-shared
make without_doc
make install
ln -s /usr/lib64/libltdl.so /usr/lib/libltdl.so
cp -frp /usr/lib64/libXpm.so* /usr/lib/
cd ..
cd soft/
tar zxvf php-5.6.31.tar.gz
tar zxvf openssl-1.0.2l.tar.gz
cd openssl-1.0.2l
./config --prefix=/usr/local/openssl
make
make install
cd ..
yum -y install curl-devel
tar zxvf php-5.6.31.tar.gz
cd php-5.6.31
./configure --prefix=/usr/local/php --with-config-file-path=/usr/local/php/etc --with-mysql-sock=/tmp/mysql.sock --with-pdo-mysql --with-gd --with-png-dir=/usr/local/libpng --with-jpeg-dir=/usr/local/jpeg --with-freetype-dir=/usr/local/freetype --with-xpm-dir=/usr/
--with-vpx-dir=/usr/local/libvpx/ --with-zlib-dir=/usr/local/zlib --with-t1lib=/usr/local/t1lib --with-iconv --enable-libxml --enable-xml --enable-bcmath --enable-shmop --enable-sysvsem --enable-inline-optimization --enable-opcache --enable-mbregex --enable-fpm
--enable-mbstring --enable-ftp --enable-gd-native-ttf --with-openssl --enable-pcntl --enable-sockets --with-xmlrpc --enable-zip --enable-soap --without-pear --with-gettext --enable-session --with-mcrypt --with-curl --enable-ctype
make
make install
cp php.ini-production /usr/local/php/etc/php.ini
cp sapi/fpm/init.d.php-fpm /etc/init.d/php-fpm
chmod +x /etc/init.d/php-fpm
chkconfig --level 2345 php-fpm on
cp sapi/fpm/php-fpm.conf /usr/local/php/etc/
vim /usr/local/php/etc/php-fpm.conf
pid = run/php-fpm.pid
error_log = /data/logs/php-fpm/error.log
include=/usr/local/php7/etc/php-fpm.d/*.conf
vim /usr/local/php/etc/php.ini
######避免PHP信息暴露在http頭中
expose_php = Off
######避免暴露php調用mysql的錯誤信息
display_errors = Off
######在關閉display_errors後開啓PHP錯誤日誌(路徑在php-fpm.conf中配置)
log_errors = On
######設置PHP的時區
date.timezone = PRC
tar zxvf redis-3.1.3.tgz
cd redis-3.1.3
/usr/local/php/bin/phpize
./configure --with-php-config=/usr/local/php/bin/php-config
make
make install
yum install cyrus-sasl-devel #必須先安裝再編譯libmemcached,不然memcached編譯會提示沒有sasl
tar zxvf libmemcached-1.0.18.tar.gz
cd libmemcached-1.0.18
./configure --prefix=/usr/local/libmemcached --with-memcached
make
make install
tar zxvf memcached-2.2.0.tgz (再高的版本需要PHP7)
cd memcached-2.2.0
/usr/local/php/bin/phpize
./configure --enable-memcached --with-php-config=/usr/local/php/bin/php-config --with-libmemcached-dir=/usr/local/libmemcached
make
make install
tar xjvf scws-1.2.3.tar.bz2
cd scws-1.2.3
./configure --prefix=/usr/local/scws
make
make install
/usr/local/scws/bin/scws -v
cd ..
cd /usr/local/scws/etc/
wget http://www.xunsearch.com/scws/down/scws-dict-chs-gbk.tar.bz2
wget http://www.xunsearch.com/scws/down/scws-dict-chs-utf8.tar.bz2
tar xvjf scws-dict-chs-gbk.tar.bz2
tar xvjf scws-dict-chs-utf8.tar.bz2
cd /data/soft/scws-1.2.3/phpext/
/usr/local/php/bin/phpize
./configure --with-scws=/usr/local/scws --with-php-config=/usr/local/php/bin/php-config
make
make install
vim /usr/local/php/etc/php.ini
extension=redis.so
extension=memcached.so
[scws]
extension = scws.so
scws.default.charset = gbk
scws.default.fpath = /usr/local/scws/etc
service php-fpm restart
vim /etc/profile
export PATH=$PATH:/usr/local/php/bin:/usr/local/php/sbin
source /etc/profile
php -m