©
本文档使用 PHP中文网手册 发布
[#1] sunny at crazytoon dot com [2007-05-23 18:09:38]
I went through and installed mcache and took notes about problems I ran in to. I couldn't get it to work in 64 bit CentOS but it works in 32 bit CentOS. If anybody got it working in 64 bit or wants to see what I have done, please feel free to visit my blog (i didn't want to spam post all the things here). Here is the blog: http://crazytoon.com/mcache
[#2] martijn at pocos dot nl [2005-08-16 04:42:14]
Trying to build PHP 5.0.4. with msession support (shared), I found that the build process still fails to link the proper libraries. I think the proper way to fix this, is to change ext/msession/config.m4 and rebuild configure.
Find the line that reads:
PHP_ADD_LIBRARY_WITH_PATH(phoenix, "$PHOENIX_DIR/lib", PHOENIX_LIB)
And replace it with these two lines:
PHP_ADD_LIBRARY_WITH_PATH(phoenix, "$PHOENIX_DIR/lib", MSESSION_SHARED_LIBADD)
PHP_ADD_LIBRARY_WITH_PATH(stdc++, "", MSESSION_SHARED_LIBADD)
Next find the line that reads:
PHP_SUBST(PHOENIX_LIB)
and replace it with:
PHP_SUBST(MSESSION_SHARED_LIBADD)
Now rebuild "configure":
$ rm configure
$ ./buildconf --force
Now ./configure && make && make install as usual.
[#3] markw at mohawksoft dot com [2005-08-13 05:10:14]
Hi all, I'm the author of the msession daemon. I haven't done any actual work on it in a couple years. Suddenly, I find myself needing it again. It's current state is almost certainly VERY different than you are used too, and it as been renamed to mcache (internally to Mohawk Software). I may ramp up work on it again.
In the course of the 5 years that msession being made available, I've gotten a lot of calls for support, and one bug fix. (And not a single donation BTW)
A decisions needs to be made if "mcache" will continue to be available. I don't mind people using it, I don't mind that I've made no money on it (that's not why I wrote it), but the desperate "my server farm is down" calls because a working system died when the admin deployed changes with out adaquite testing are a huge distraction. In good conscience, I can't let the poor guy twist in the wind, but sometimes it takes hours to fix. Hours away from work that pays my bills or my family. Apache 2.0 with multiple threads really caused a lot of problems.
So, I guess what I'm saying is this: msession will become mcache (publically) some time in the future. On modern hardware it can handle about 5,000 ~10,000 session transactions a second (depending on the amount of data in the session, and the conectivity to the nodes, etc.) I may keep it on my server, but I can't support it for you without being paid up front. If you use it: learn it, know it, live it, and contribute if you can.
[#4] [2005-08-08 05:29:32]
I could not compile it on FreeBSD. On a 4.x msession complained about missing pthread library. On a 5.x, it was not happy with malloc.h. Ok, I could dig into that problem and find the problem. But I was not motivated...
I found that there is 1 100% PHP Solution for distributed session handling:
http://pear.php.net/package/HTTP_SessionServer/
[#5] sgaffga at electronicpartner dot de [2005-07-14 02:18:15]
We wanted to use the default-PHP4-RPMs delivered with RedHat and SuSE, and use msession, too. But there is no package containing the precompiled msession-support for PHP. So I did this on my own and I found it very hard, so I'd like to provide the solution here.
The files php-msession-030117.tar.gz, phoenix-R1_2_030117E.tar.gz and msession-030130.tar.gz are
available at www.mohawksoft.com.
## Compiling the phoenix lib
tar xzf phoenix-R1_2_030117E.tar.gz
tar xzf msession-030130.tar.gz
cd phoenix/src/
cp Linux.mak config.mak
vi unixgcc.mak
(Now change "-I$(POSTGRES_HOME)/include" to "-I /usr/include/pgsql" which is needed to compile using SuSE 9.3)
make
mkdir ../lib
make install
## Compiling msession server
cd ..
cd msession
make
mkdir ../bin
make install
## Now untar PHP-Source and replace the files in ext/msession/ with the ones supplied by php-msession-030117.tar.gz
## Configure PHP and include --with-msession=shared,/path/to/phoenix-src-used-above
## Please note: Compile will fail if you use --disable-session or --disable-all
## For example use:
./configure --prefix=/usr/local --with-config-file-path=/etc --disable-all --enable-session --with-msession=shared,/home/sga/compile/phoenix
make
## Now there is a msession.so in modules/, but this one does NOT work yet.
## I had to repeat the libtool-command with "--mode=link gcc" and add some libs:
## before the last parameter I added:
## -lstdc++ -lodbc -L/home/sga/compile/phoenix/lib/ -lphoenix
## This was the command I used (you will have to use other paths of course)
/bin/sh /home/sga/compile/php-4.3.10/libtool --silent --preserve-dup-deps --mode=link gcc -DPHP_ATOM_INC -I/home/sga/compile/php-4.3.10/include -I/home/sga/compile/php-4.3.10/main -I/home/sga/compile/php-4.3.10 -I/home/sga/compile/php-4.3.10/Zend -I/home/sga/compile/php-4.3.10/ext/xml/expat -I/home/sga/compile/php-4.3.10/TSRM -g -O2 -o ext/msession/msession.la -export-dynamic -avoid-version -prefer-pic -module -rpath /home/sga/compile/php-4.3.10/modules -lstdc++ -lodbc -L/home/sga/compile/phoenix/lib/ -lphoenix ext/msession/msession.lo
## Now I could do:
cp ext/msession/.libs/msession.so /usr/local/lib/php/extensions/no-debug-non-zts-20020429
## (Please note the different location I copy the module from)
## Adjust your php.ini to contain "extension=msession.so" and
## "extension_path =/usr/local/lib/php/extensions/no-debug-non-zts-20020429"
rcapache2 restart
## Now it worked fine! I hope this helps someone.
[#6] r_linux at yahoo dot com [2005-04-13 08:33:08]
To compile with --with-msession, you have to make a change in Makefile to add -lstdc++. For me the LDFLAGS=-lstdc++ before ./configure don't work.
That modification works for me:
sed -e 's/^\(EXTRA_LIBS\)\(.*\)$/\1\2 -lstdc++/g' Makefile -i
I think that have some better way to do it.
[#7] temp6453 at hotmail dot com [2005-03-10 13:21:15]
A company I work for uses msession for a large cluster of servers. I've set it up rather regularly and never had an issue at all with it not working.
Msession is stable. It does something simple- it maintains an efficient database of key->value (session->data) pairs and searches them well in a nice threaded manner. There is no need for constant revision. It is _NOT_ a large application. It's security is simply IP-block-based, so such concerns are also minimal.
To the user that says it should be removed- if you are having problems installing it, seek assistance doing so. The product itself is just right.
[#8] Weird Silence [2005-02-01 05:19:51]
We've created a distributed session handler that uses memcached - Check it out at http://weirdsilence.net/software/memsession/ - It's free and open source!
It uses Danga.com's memcached: http://danga.com/memcached/ - Very cool stuff!
[#9] aderyngmailcom [2004-11-06 15:52:09]
[#10] mathijs at experimental dot net [2002-09-13 09:02:05]
msession 1.0 (020603) is using /dev/urandom.
[#11] a dot whyte at cqu dot edu dot au [2002-05-09 05:53:51]
You can fix the no random data in FreeBSD's /dev/random by using rndcontrol (as root) and setting the interupts which it looks at for entropy.
Something like rndcontrol -s 14 -s 15 should help it out.
[#12] carsten at sarum dot dk [2002-05-06 15:12:32]
If you have trouble connecting to the msessiond from a php-script, this might be the solution for you.
msessiond (and your php-extension) both use the libphoenix.a which, among other files, is built from a file called "mutils.cpp".
Open this file, and find a line saying:
FILE *f = fopen("/dev/random", "rb");
(I believe it is line 506. There's only this one.)
On my FreeBSD 4.5 Tiny, /dev/random seldom spits out data, so the program hangs on the next line (an fread() call). Use /dev/urandom instead, it always sends data.
Change the line above to:
FILE *f = fopen("/dev/urandom", "rb");
Then rebuild phoenix-lib, msessiond, and PHP. You might want to do a "make clean" to be sure the change is noted.
- Carsten