Ò׽ؽØͼÈí¼þ¡¢µ¥Îļþ¡¢Ãâ°²×°¡¢´¿ÂÌÉ«¡¢½ö160KB

¹ØÓÚMemcacheDB PHP¿Í»§¶ËµÄÎÊÌâ¼°½â¾ö°ì·¨

http://blog.developers.api.sina.com.cn/?p=264
×î½üMemcacheDBÓʼþÁбíºÍÑз¢²¿ÄDZßͬʱ¨¸æPHPµÄmemcache¿Í»§¶Ëphp-memcache¾­³£³ö ÏÖ¶ÏÁ¬½ÓµÄÎÊÌ⣺
PHP Notice:  Memcache::get(): Server ………. (tcp 11211) failed with: Failed reading line from stream (0) with pecl-memcache 3.*
….
Õâ¸öÎÊÌâÓÉÀ´ÒѾã¬ÎÒÃǵĽâÊÍÊÇMemcacheDBµÄÑÓ³ÙÊÜ´ÅÅÌдÈëÓ°Ïì (checkpointʱ, memtrickleʱ)»áÓÐÒ»µãµÄ¸¡¶¯¡£ËäÈ»ÕûÌåÑÓ³Ù²»ÊǺܸߣ¬µ«ÊÇ Ïà±ÈÓÚMemcached´¿ÄÚ´æÉԸߡ£¶øPHP memcacheºê¹ÛÉÏÈÏΪÊÇcacheÐÐΪ£¬»á¶ÔÑÓ ³ÙÉԸߵÄÁ¬½ÓÈÓµô£¨ÆäÈÏΪÑӳٸ߾ÍʧȥcacheµÄÒâÒ壩¡£
½â¾ö°ì·¨ÊÇʹÓÃandreizµÄphp-memcached:
http://pecl.php.net/package/memcached
http://github.com/andreiz/php-memcached/tree/master
php-memcachedÊÇbrianµÄlibmemcached¿âµÄphp wrapper. libmemcachedÊÇÒ»¸ö ǰ;¹âÃ÷µÄmemcacheЭÒéc/c++¿Í»§¶Ë¿â£¬Î´À´¶Ô¶þ½øÖÆ°æ±¾µÄÖ§³Ö£¬ÁíÍ⼫ÓпÉÄÜ°üÀ¨MemcacheDBµÄÀ©Õ¹ÃüÁîrgetµÈµÄÖ§³Ö£¨ÒѾ­ÁªÏµºÃ×÷ÕßÌá½»patch£©
ÎÒ¶Ôphp-memcacheºÍphp-memcachedÁ½¸ö¿Í»§¶Ë×÷Á˼òµ¥µÄÆÀ¹À¡£·Ö±ðset 1000 ÍòÌõ200×Ö½ÚµÄvalue£¬ÆäÖÐphp-memcache±íÏֵôàÈõ£¬Á¬½ÓƵƵ¶Ïµô¡£¶øphp- memcachedÒÀÈ»±£³Ö¼áͦ£¬´Óδ¶Ï¹ý¡£


Ïà¹ØÎĵµ£º

PHPÉú³ÉwordÎĵµ

<?PHP
$word = new COM("word.application") or die("Can't start Word!");
// print the version of Word that's now in use
echo "Loading Word, v. {$word->Version}";
// set the visibility of the application to 0 (false)
// to open the application in the forefront, use 1 (true)
$word->Visibl ......

php³öÏÖÍøÒ³ÂÒÂëÎÊÌâ

ÓÃPHPmyAdmin²Ù×÷MySQLÊý¾Ý¿âºº×ÖÏÔʾÕý³£ £¬µ«ÓÃPHPÍøÒ³ÏÔʾMySQLÊý¾ÝʱËùÓкº×Ö¶¼±ä³ÉÁË?ºÅ¡£
Ö¢×´£ºÓÃPHPmyAdminÊäÈ뺺×ÖÕý³££¬µ«µ±PHPÍøÒ³ÏÔʾMySQLÊý¾Ýʱºº×־ͱä³ÉÁË?ºÅ£¬²¢ÇÒÓжàÉÙ¸öºº×Ö¾ÍÓжàÉÙ¸ö?ºÅ¡£ºÜ¶àѧԱ¶¼Óöµ½ÁË´ËÎÊÌ⣬ÓÈÆäÊÇÔÚ°²×°ÁË×îаæµÄAppservºó¡£Îª´ËÐí¶àѧԱ·ÅÆúÁËPHP£¬¸ÄѧASPÁË¡£
Ô­Òò£ºÃ» ......

ѧϰPHP ÒýÓ÷µ»Ø ÒÔ&¿ªÍ·µÄº¯Êý µÄºÃÀý×Ó

<?php
$a = 1;
function b(&$c)
{
$c++;
return $c;
}
$d=b($a); // d = 2; a = 2;
$d++; // d = 2;
echo($a); // ÏÔʾ2
?>
ÒýÓ÷µ»Ø:
<?php
$a = 1;
function &b(&$c)
{
$c++;
return $c;
}
$d=b($a); // ×¢ÒâÕâÀï dÓëb·µ»ØµÄÖµ(È·ÇÐÀ´Ëµ, ÕâÀï·µ»ØµÄ² ......

phpµã»÷ÏÂÔØtxtÎļþ

ÓÉÓÚÏÖÔÚµÄä¯ÀÀÆ÷ÒѾ­¿ÉÒÔʶ±ð¸ñʽΪtxtµÄÎĵµ¸ñʽ£¬ËùÒÔÈç¹ûÖ»ÊǸøtxtÎĵµ×öÒ»¸öÎÄ×ÖÁ´½ÓµÄ»°£¬¿ÉÄÜÖ»ÊÇ´ò¿ªÒ»¸öд°¿ÚÏÔʾtxtÎļþµÄÄÚÈÝ£¬²¢²»ÄÜʵÏÖµã»÷ÏÂÔصÄÄ¿µÄ¡£We have to do something else.
    µ±È»Õâ¸öÎÊÌâµÄ½â¾ö°ì·¨Ò²¿ÉÒÔÊÇÄ㽫ÄãµÄtxtÎļþ¸ÄÃûΪä¯ÀÀÆ÷²»ÈÏʶµÄÎļþ£¬±ÈÈçrar,ÕâÑùµÄ»°µã»÷£¬ ......

PHPÖÐʹÓÃHTTPЭÒéµÄ״̬Âë

<?PHP
/**
* HTTP Protocol defined status codes
* @param int $num
*/
function https($num) {
$http = array (
100 => "HTTP/1.1 100 Continue",
101 => "HTTP/1.1 101 Switching Protocols",
200 => "HTTP/1.1 200 OK",
201 => "HTTP/1.1 201 Created",
202 => "HTTP/1.1 202 ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ