memcache安装与配置详解

作者 : admin 于 2008-05-19 10:44:18 标签: , ,
2008
05-19
libevent-1.2.tar.gz
memcache-3.0.1.tgz
memcached-1.2.0.tar.gz

安装 libevent-1.2.tar.gz
./configure
make && make install

chmod 644 /usr/local/lib/libevent.a
PATH=”$PATH:/sbin” ldconfig -n /usr/local/lib
———————————————————————-
Libraries have been installed in:
/usr/local/lib
If you ever happen to want to link against installed libraries
in a given directory, LIBDIR, you must either use libtool, and
specify the full pathname of the library, or use the `-LLIBDIR’
flag during linking and do at least one of the following:
- add LIBDIR to the `LD_LIBRARY_PATH’ environment variable
during execution
- add LIBDIR to the `LD_RUN_PATH’ environment variable
during linking
- use the `-Wl,–rpath -Wl,LIBDIR’ linker flag
- have your system administrator add LIBDIR to `/etc/ld.so.conf’
See any operating system documentation about shared libraries for
more information, such as the ld(1) and ld.so(8) manual pages.
———————————————————————-
test -z “/usr/local/include” || mkdir -p — . “/usr/local/include”
/usr/bin/install -c -m 644 ‘event.h’ ‘/usr/local/include/event.h’
/usr/bin/install -c -m 644 ‘evhttp.h’ ‘/usr/local/include/evhttp.h’
/usr/bin/install -c -m 644 ‘evdns.h’ ‘/usr/local/include/evdns.h’
test -z “/usr/local/man/man3″ || mkdir -p — . “/usr/local/man/man3″
/usr/bin/install -c -m 644 ‘./event.3′ ‘/usr/local/man/man3/event.3′
/usr/bin/install -c -m 644 ‘./evdns.3′ ‘/usr/local/man/man3/evdns.3′

安装 memcached-1.2.0.tar.gz
./configure
make && make install

Making install in doc
make[1]: Entering directory `/root/memcached-1.2.0/doc’
make[2]: Entering directory `/root/memcached-1.2.0/doc’
make[2]: Nothing to be done for `install-exec-am’.
/bin/sh ../mkinstalldirs /usr/local/man/man1
/usr/bin/install -c -m 644 ./memcached.1 /usr/local/man/man1/memcached.1
make[2]: Leaving directory `/root/memcached-1.2.0/doc’
make[1]: Leaving directory `/root/memcached-1.2.0/doc’
make[1]: Entering directory `/root/memcached-1.2.0′
make[2]: Entering directory `/root/memcached-1.2.0′
/bin/sh ./mkinstalldirs /usr/local/bin
/usr/bin/install -c memcached /usr/local/bin/memcached
/usr/bin/install -c memcached-debug /usr/local/bin/memcached-debug

启动 -d守护进程 -m内存分配 -u 用户 -l监听地址 -p 端口 -P pid文件
memcached -d -m 100 -u root -l 127.0.0.1 -p 8000 -P /tmp/mem.pid

安装 memcache-3.0.1.tgz
phpize
./configure
make && make install

gcc -shared .libs/memcache.o .libs/memcache_pool.o .libs/memcache_queue.o .libs/memcache_ascii_protocol.o .libs/memcache_binary_protocol.o .libs/memcache_standard_hash.o .libs/memcache_consistent_hash.o .libs/memcache_session.o -Wl,-soname -Wl,memcache.so -o .libs/memcache.so
creating memcache.la
(cd .libs && rm -f memcache.la && ln -s ../memcache.la memcache.la)
/bin/sh /root/memcache-3.0.1/libtool –mode=install cp ./memcache.la /root/memcache-3.0.1/modules
cp ./.libs/memcache.so /root/memcache-3.0.1/modules/memcache.so
cp ./.libs/memcache.lai /root/memcache-3.0.1/modules/memcache.la
PATH=”$PATH:/sbin” ldconfig -n /root/memcache-3.0.1/modules
———————————————————————-
Libraries have been installed in:
/root/memcache-3.0.1/modules
If you ever happen to want to link against installed libraries
in a given directory, LIBDIR, you must either use libtool, and
specify the full pathname of the library, or use the `-LLIBDIR’
flag during linking and do at least one of the following:
- add LIBDIR to the `LD_LIBRARY_PATH’ environment variable
during execution
- add LIBDIR to the `LD_RUN_PATH’ environment variable
during linking
- use the `-Wl,–rpath -Wl,LIBDIR’ linker flag
- have your system administrator add LIBDIR to `/etc/ld.so.conf’
See any operating system documentation about shared libraries for
more information, such as the ld(1) and ld.so(8) manual pages.
———————————————————————-
Build complete.
Don’t forget to run ‘make test’.
Installing shared extensions: /usr/local/lib/php/extensions/no-debug-non-zts-20060613/

php.ini extent 加载 memcache.so
重启使其生效即可

发表评论




XHTML:你可以使用的标签: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

(若看不到验证码,请重新加载页面。)