cd ~/install/lnmp0.3/php-5.2.10/
./configure --prefix=/usr/local/php --with-config-file-path=/usr/local/php/etc --with-mysql=/usr/local/mysql --with-iconv-dir=/usr/local --with-jpeg-dir --with-png-dir --with-zlib --with-libxml-dir=/usr --enable-xml --disable-rpath --enable-discard-path --enable-bcmath --enable-shmop --enable-inline-optimization --with-curl --with-curlwrappers --enable-mbregex --enable-fastcgi --enable-fpm --enable-force-cgi-redirect --enable-mbstring --with-mcrypt --with-mhash --enable-zip --without-pear --with-mime-magic=/usr/share/file/magic.mime
make ZEND_EXTRA_LIBS='-liconv'
make install
<?php
echo "hello";
$memcachehost = '127.0.0.1';
$memcacheport = 10255;
$memcachelife = 36000;
$memcache = new Memcache;
$memcache->connect($memcachehost,$memcacheport) or die ("Could not connect");
$memcache->set('key','medcl');
$get = $memcache->get('key'); //»ñ?¢
echo $get;
?>
cd ~/install/lnmp0.3/php-5.2.10/
./configure --prefix=/usr/local/php --with-config-file-path=/usr/local/php/etc --with-mysql=/usr/local/mysql --with-iconv-dir=/usr/local --with-freetype-dir --with-jpeg-dir --with-png-dir --with-zlib --with-libxml-dir=/usr --enable-xml --disable-rpath --enable-discard-path --enable-safe-mode --enable-bcmath --enable-shmop --enable-sysvsem --enable-inline-optimization --with-curl --with-curlwrappers --enable-mbregex --enable-fastcgi --enable-fpm --enable-force-cgi-redirect --enable-mbstring --with-mcrypt --with-mhash --enable-pcntl --enable-sockets --with-xmlrpc --enable-zip --enable-ftp --without-pear --with-mime-magic=/usr/share/file/magic.mime
make ZEND_EXTRA_LIBS='-liconv'
make install
<?php
echo "hello";
$memcachehost = '127.0.0.1';
$memcacheport = 10255;
$memcachelife = 36000;
$memcache = new Memcache;
$memcache->connect($memcachehost,$memcacheport) or die ("Could not connect");
$memcache->set('key','medcl');
$get = $memcache->get('key'); //»ñ?¢
echo $get;
$key="key1";
if ( !($datas = $memcache->get($key)) ) {
echo "n".str_pad('Read datas from MySQL.', 60, '_')."n";
$memcache->set($key, 'data');
} else {
echo "get from cache".$datas;
}
var_dump($datas);
?>