wdcp上安装memcache

首先要yum需要的开发包

yum install libevent-devel

1、安装memcached

http://memcached.org/
http://www.memcached.org/files/memcached-1.5.3.tar.gz

./configure –prefix=/usr/local/memcached –with-libevent=/usr/lib/
make
make install

2、编译php的memcache模块

http://pecl.php.net/package/memcache
http://pecl.php.net/get/memcache-2.2.7.tgz

/www/wdlinux/php/bin/phpize
./configure –with-php-config=/www/wdlinux/php/bin/php-config

make
make install

3、设置php配置文件加载memcache模块

/www/wdlinux/php/etc/php.ini
extension_dir = “/www/wdlinux/php/lib/php/extensions/no-debug-non-zts-20090626/”
extension=memcache.so

4、启动memcached服务

/usr/local/memcached/bin/memcached -d -m 1024 -p 11211 -u root

 

可能会遇到的问题:
checking build system type… Invalid configuration `: machine ` not recognized

解决办法是:

先安装好memcached后,再编译php的memcahe模块

centos下php扩展安装imagemagick

对于php的imagick主要是两部分的安装

ImageMagick主程序地址
http://www.imagemagick.org/script/download.php

ImageMagick最后的一个版本是6.9.2-4

默认官方网站会提供一个Centos5.11的32位版和Centos7.1的64位版,如果是匹配的系统可以直接用rpm方式安装
http://www.imagemagick.org/download/linux/CentOS/i386/ImageMagick-6.9.2-4.i386.rpm
http://www.imagemagick.org/download/linux/CentOS/x86_64/ImageMagick-6.9.2-4.x86_64.rpm

windows下可以通过以下命令查看
identify -version

编译源码下载地址是
http://www.imagemagick.org/download/ImageMagick.tar.gz

编译过程
tar xvzf ImageMagick.tar.gz
cd ImageMagick-6.9.2
./configure
make
make install

注:如果不指定安装目录编译好后执行文件会自动放到/usr/local/bin/中

编译过程中会有一些提示
coders/png.c: In function ‘ReadOnePNGImage’:
coders/png.c:2238: warning: passing argument 3 of ‘png_set_keep_unknown_chunks’ discards qualifiers from pointer target type
/usr/include/libpng12/png.h:2587: note: expected ‘png_bytep’ but argument is of type ‘const png_byte *’
coders/png.c:2249: warning: passing argument 3 of ‘png_set_keep_unknown_chunks’ discards qualifiers from pointer target type
/usr/include/libpng12/png.h:2587: note: expected ‘png_bytep’ but argument is of type ‘const png_byte *’

动态编译php的imagick模块
php的ImageMagick扩展程序访问主页
http://pecl.php.net/package/imagick/

最新php的imagick模块版本是3.1.2,下载地址是
http://pecl.php.net/get/imagick-3.1.2.tgz

tar zxvf imagick-3.1.2.tgz
cd imagick-3.1.2
phpize
注:如果不能直接使用要找到phpize的所在路径,加上路径去执行
./configure –with-php-config=/www/wdlinux/php/bin/php-config
注:–with-php-config=的路径是实际的php的bin路径,因不同环境配置而异
make
make install

编译好后会生成一个imagick.so文件

最后在php.ini中添加: extension = imagick.so
通过php -m查看模块是否加载成功