Chinaunix首页 | 论坛 | 博客
  • 博客访问: 2120318
  • 博文数量: 82
  • 博客积分: 2010
  • 博客等级: 大尉
  • 技术积分: 880
  • 用 户 组: 普通用户
  • 注册时间: 2005-03-14 00:01
文章分类

全部博文(82)

文章存档

2014年(1)

2011年(1)

2009年(8)

2008年(11)

2007年(13)

2006年(26)

2005年(22)

我的朋友

分类:

2007-04-27 13:40:39

在fc3上升级php5.2.1
 
1.安装memcached
先安装libevent,
[root@www lamp]# tar zxvf libevent-1.3b.tar.gz
[root@www lamp]# cd libevent-1.3b
[root@www libevent-1.3b]# ./configure && make
[root@www libevent-1.3b]# make install
可以测试一下
[root@www libevent-1.3b]# make verify
可以装memcached了
[root@www lamp]# tar zxvf memcached-1.2.1.tar.tar
[root@www lamp]# cd memcached-1.2.1
[root@www memcached-1.2.1]# ./configure && make && make install
[root@www memcached-1.2.1]# memcached --help
memcached: error while loading shared libraries: libevent-1.3b.so.1: cannot open shared
object file: No such file or directory
竟然出错?但是明明有/usr/local/lib/libevent-1.3b.so.1这个文件呀
于是重编译libevent和memcached,在configure时全加参数--prefix=/usr,这下可以了
[root@www memcached-1.2.1]# memcached -help
memcached 1.2.1
-p       TCP port number to listen on (default: 11211)
-U       UDP port number to listen on (default: 0, off)
-s      unix socket path to listen on (disables network support)
-l   interface to listen on, default is INDRR_ANY
-d            run as a daemon
-r            maximize core file limit
-u assume identity of (only when run as root)
-m       max memory to use for items in megabytes, default is 64 MB
-M            return error on memory exhausted (rather than removing items)
-c       max simultaneous connections, default is 1024
-k            lock down all paged memory
-v            verbose (print errors/warnings while in event loop)
-vv           very verbose (also print client commands/reponses)
-h            print this help and exit
-i            print memcached and libevent license
-b            run a managed instanced (mnemonic: buckets)
-P      save PID in , only used with -d option
-f    chunk size growth factor, default 1.25
-n     minimum space allocated for key+value+flags, default 48
因为机器差,所以内存只分配16M给memcached
[root@www memcached-1.2.1]# memcached -d -m 16
can't run as root without the -u switch
还不能用root启动,那就换成
[root@www memcached-1.2.1]# memcached -d -m 16 -u nobody
2.安ImageMagick
[root@www lamp]# tar jxvf ImageMagick-6.3.3-10.tar.bz2
[root@www lamp]# cd ImageMagick-6.3.3
[root@www ImageMagick-6.3.3]# ./configure && make && make install
完了测试一下:
/usr/local/bin/convert logo: logo.gif
现在要解开php5.2.1,把imagemagick的php扩展放进去
[root@www ImageMagick-6.3.3]# cd ..
[root@www lamp]# tar zxvf MagickWandForPHP-1.0.4.tar.gz
[root@www lamp]# tar jxvf php-5.2.1.tar.bz2
[root@www lamp]# mv MagickWandForPHP-1.0.4 php-5.2.1/ext/magickwand
[root@www lamp]# cd php-5.2.1

[root@www php-5.2.1]# ./configure --help | grep magickwand
看,没得到任何信息
[root@www php-5.2.1]# cd ext/magickwand/
[root@www magickwand]# phpize
Configuring for:
PHP Api Version:         20020918
Zend Module Api No:      20020429
Zend Extension Api No:   20021010
其实现在用的phpize是php4.3.11的,可能不适合php5.2.1编译用吧
[root@www magickwand]# cd ../..
[root@www php-5.2.1]# rm ./configure
[root@www php-5.2.1]# ./buildconf --force
[root@www php-5.2.1]# ./configure --help | grep magickwand
  --with-magickwand=DIR Include Magickwand support
3.安装php
[root@www php-5.2.1]#./configure --with-apxs2=/usr/local/apache/bin/apxs --with-mysql \
--enable-calendar --enable-force-cgi-redirect --enable-gd-imgstrttf \
--enable-gd-native-ttf --enable-inline-optimization --enable-memory-limit \
--with-bz2 --with-ftp --with-png-dir=/usr --with-xml --with-zlib=yes \
--with-gd=yes --enable-mbstring --with-png-dir=/usr --with-ttf \
--with-freetype-dir=/usr/local --enable-ctype --enable-dbase --enable-ftp \
--with-ftp --with-gdbm --with-gettext --with-tiff-dir=/usr \
--with-magickwand=/usr --with-curl --with-curlwrappers --with-iconv \
--with-jpeg-dir=/usr
特别注意最后 --width-jpeg-dir=/usr ,原来在php4编译时没加这个的,但现在不加 gd就不能用jpeg
[root@www php-5.2.1]# make
[root@www php-5.2.1]# make install
然后进/usr/local/apache/,编辑conf/httpd.conf,把php4_module那一行注释掉
#LoadModule php4_module        modules/libphp4.so
LoadModule php5_module        modules/libphp5.so
AddType application/x-httpd-php .php .phtml
运行bin/apachectl restart重启apache,再用phpinfo看信息
最后写一个magickwand的脚本测试一下,一切就结束了。只是不知有个国外的脚本为什么会超时,在
windows下是正常的
 
 
阅读(1288) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~