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

APC(Alternative PHP Cache)

APCÊÇÒ»ÖÖphpµÄ»º´æ½â¾ö·½°¸,ĿǰÒÔpecl·½Ê½·¢²¼,ÓÐÏûϢ˵½«»á³öÏÖÔÚphp6°æ±¾µÄÄÚºË.
Ò».°²×°·½·¨
1)´Óhttp://pecl.php.net/package/apcÏÂÔØÏàÓ¦°æ±¾
2)½âѹ
3)½øÈëÔ´ÂëĿ¼
4)Ö´ÐÐphp°²×°Ä¿Â¼ÏµÄbin/phpize
5)./configure --enable-apc --enable-apc-mmap --with-apxs=path-to-apache/bin/apxs --with-php-config=path-to-php/bin/php-config
6)make && make install
7)½«Éú³ÉµÄapc.so¼ÓÔØµ½php.ini(extesion=apc.so,×¢Òâextension_dirµÄÉèÖÃ)
Ò»°ãµØ,±àÒëÉú³ÉµÄ.so»áÔÚphp°²×°Â·¾¶µÄlib/php/extensionsÏÂ
8)ÖØÆô,apache
дһ¸öphpinfo¿´¿´
×¢:windowsÏÂ,Ö»Òªµ½http://snaps.php.net/µÄÏàÓ¦·ÖÖ§ÏÂÏÂÔØphp_apc.dll,ÔÙÔÚphp.iniÖмÓÔØ¼´¿É
¶þ.Ó÷¨
apcµÄÓ÷¨±È½Ï¼òµ¥,Ö»Óм¸¸öº¯Êý,ÁоÙÈçÏÂ
apc_clear_cache() Çå³ýapc»º´æÄÚÈÝ
ĬÈÏ(ÎÞ²ÎÊý)ʱ,Ö»Çå³ýϵͳ»º´æ,ÒªÇå³ýÓû§»º´æ,ÐèÓÃ'user'²ÎÊý
apc_define_constants ( string key, array constants [, bool case_sensitive] )
½«Êý×éconstantsÒÔ³£Á¿¼ÓÈ뻺´æ
apc_load_constants (string Key)
È¡³ö³£Á¿»º´æ
apc_store ( string key, mixed var [, int ttl] )
ÔÚ»º´æÖб£´æÊý¾Ý
apc_fetch ( string key )
»ñµÃapc_store±£´æµÄ»º´æÄÚÈÝ
apc_delete ( string key )
ɾ³ýapc_store±£´æµÄÄÚÈÝ
ÍêÕûÀý×ÓÈçÏÂ:
<?php
//apc test
//constants
$constants = array('APC_FILE'   => 'apc.php', 'AUTHOR'   => 'tim');
apc_define_constants('numbers', $constants);
apc_load_constants('numbers');
echo 'APC_FILE='.APC_FILE.'<br>';
echo 'AUTHOR='.AUTHOR.'<br>';
//variable
if(!apc_fetch('time1')) apc_store('time1', time());
if(!apc_fetch('time2')) apc_store('time2', time(),2); //set ttl
echo 'time1:'.apc_fetch('time1').'<br>';
echo 'time2:'.apc_fetch('time2').'<br>';
//object
class a{
     function b(){return 'i am b in class a';}
}
apc_store('obj',new a());
$a = apc_fetch('obj');
echo $a->b();
echo '<br>';
//array
$arr = array('a'=>'i am a','b'=>'i am b');
apc_store('arr',$arr);
$apc_arr = apc_fetch('arr');
print_r($apc_arr);
?>
Ìáʾ:Äã¿ÉÒÔË¢ÐÂÒ»ÏÂ,¿´tt


Ïà¹ØÎĵµ£º

php variable circular reference

 
Php Variable Circular References

Circular-references has been a long outstanding issue with PHP. They are
caused by the fact that PHP uses a reference counted memory allocation
mechanism for its internal variables. This causes problems for longer
running scripts (such as an Applicatio ......

php variable circular reference ·­Òë

    Ñ­»·ÒýÓÃÒ»Ö±ÊÇPHP£¨Ó¦Óã©ÖÐÒ»¸öÍ»³öµÄÎÊÌâ¡£ÎÊÌâµÄ³öÏÖÊÇÓÉÓÚÕâÑùµÄÒ»¸öÊÂʵ£ºPHPΪphpÄÚ²¿±äÁ¿Ê¹ÓÃÒ»¸ö“ÒýÓüÆÊýÆ÷”ÄÚ´æ·ÖÅä»úÖÆ¡£ÕâÒ»»úÖÆ¶ÔһЩÏà±ÈÀ´Ëµ½Ï³¤Ê±¼äÔËÐеĽű¾£¨±ÈÈ磬ӦÓ÷þÎñÆ÷»òÕßeZ²âÊÔ×é¼þ£©»áÒý·¢ÎÊÌ⣬ÒòΪÄÚ´æÔڽű¾½áÊøÇ°Ê²»»á±»ÊͷŵôµÄ¡£µ«ÊÇ£¬£¨¼¸ºõ£©Ã»ÓÐÈË ......

jquery php ajax json

just get a json
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title></title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<mce:script src="jquery-1.3.2.min.js" mce_src="jq ......

php±àÂëת»»×ܽá

iconvº¯Êý¿âÄܹ»Íê³É¸÷ÖÖ×Ö·û¼¯¼äµÄת»»£¬ÊÇphp±à³ÌÖв»¿ÉȱÉٵĻù´¡º¯Êý¿â¡£
1¡¢ÏÂÔØlibiconvº¯Êý¿âhttp://ftp.gnu.org/pub/gnu/libiconv/libiconv-1.9.2.tar.gz£»
2¡¢½âѹËõtar -zxvf libiconv-1.9.2.tar.gz;
3¡¢°²×°libiconv
££configure --prefix=/usr/local/iconv
#make
#make install
4¡¢ÖØÐ±àÒëphp Ô ......

PHP»á»°(Session)ʹÓÃÈëÃÅ


¡¡¡¡¶Ô±ÈÆð Cookie£¬Session ÊÇ´æ´¢ÔÚ·þÎñÆ÷¶ËµÄ»á»°£¬Ïà¶Ô°²È«£¬²¢ÇÒ²»Ïñ Cookie ÄÇÑùÓд洢³¤¶ÈÏÞÖÆ£¬±¾Îļòµ¥½éÉÜ Session µÄʹÓá£
¡¡¡¡ÓÉÓÚ Session ÊÇÒÔÎı¾ÎļþÐÎʽ´æ´¢ÔÚ·þÎñÆ÷¶ËµÄ£¬ËùÒÔ²»Å¿ͻ§¶ËÐÞ¸Ä Session ÄÚÈÝ¡£Êµ¼ÊÉÏÔÚ·þÎñÆ÷¶ËµÄ Session Îļþ£¬PHP ×Ô¶¯ÐÞ¸Ä Session ÎļþµÄȨÏÞ£¬Ö»±£ÁôÁËϵͳ¶ÁºÍдȨ ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØÍ¼ | ¸ÓICP±¸09004571ºÅ