php拡張子のインストール
入社後2番目のタスク:php拡張子のインストール:memcache,redis,imagick,magickwand,scws
#!/bin/bash
#php
#Email:[email protected]
#autor:fujinzhou
#create time: 2016-11-29
# php-memecache
wget https://pecl.php.net/get/memcache-3.0.8.tgz
tar zxvf memcache-3.0.8.tgz && mv /usr/local/memcache
cd /usr/local/memcache
/usr/local/php/bin/phpize
./configure --enable-memcache --with-php-config=/usr/local/php/bin/php-config --with-zlib-dir
make && make install
# phpredis
wget https://github.com/nicolasff/phpredis/archive/2.2.4.tar.gz
tar -xf phpredis-2.2.4.tar.gz && cd phpredis-2.2.4
/usr/local/php/bin/phpize
./configure --with-php-config=/usr/local/php/bin/php-config
make && make install
# imagick
wget http://nchc.dl.sourceforge.net/project/p_w_picpathmagick/old-sources/6.x/6.8/ImageMagick-6.8.9-10.tar.gz
tar -xf ImageMagick-6.8.9-10.tar.gz
cd ImageMagick-6.8.9-10
./configure --prefix=/usr/local/p_w_picpathmagick
make && make install
wget http://pecl.php.net/get/imagick-3.1.2.tgz
cd imagick-3.1.2
/usr/local/php/bin/phpize
./configure --with-php-config=/usr/local/php/bin/php-config --with-imagick=/usr/local/p_w_picpathmagick/
make && make install
# magickwand
wget ftp://ftp.fifi.org/ImageMagick/php/releases/MagickWandForPHP-1.0.9-2.tar.gz
tar -xf MagickWandForPHP-1.0.9-2.tar.gz
cd MagickWandForPHP-1.0.9
/usr/local/php/bin/phpize
./configure --with-php-config=/usr/local/php/bin/php-config --enable-shared --with-magickwand=/usr/local/p_w_picpathmagick
make && make install
# scws
wget http://www.ftphp.com/scws/down/scws-1.2.0.tar.bz2
tar -xjf scws-1.2.0.tar.bz2
cd scws-1.2.0
./configure --prefix=/usr/local/scws
make && make install
cd phpext/
/usr/local/php/bin/phpize
./configure --with-scws=/usr/local/scws/ --with-php-config=/usr/local/php/bin/php-config
make && make install
#
rm phpredis-2.2.4 -rf
rm ImageMagick-6.8.9-10 -rf
rm imagick-3.1.2 -rf
rm MagickWandForPHP-1.0.9 -rf
rm scws-1.2.0 -rf
'''
[scws]
extension = scws.so
extension_dir = /usr/local/php/lib/php/extensions/no-debug-non-zts-20131226/
scws.default.charset = utf8
scws.default.fpath = /usr/local/scws/etc
[redis]
extension = redis.so
extension_dir = /usr/local/php/lib/php/extensions/no-debug-non-zts-20131226/
[memcache]
extension = memcache.so
extension_dir = /usr/local/php/lib/php/extensions/no-debug-non-zts-20131226/
[imagick]
extension = imagick.so
extension_dir = /usr/local/php/lib/php/extensions/no-debug-non-zts-20131226/
[magickwand]
extension = magickwand.so
extension_dir = /usr/local/php/lib/php/extensions/no-debug-non-zts-20131226/
'''