php´óÎļþµÄÉÏ´«
1.ʹÓÃPHPµÄ´´Ê¼ÈË Rasmus Lerdorf дµÄAPCÀ©Õ¹Ä£¿éÀ´ÊµÏÖ£¨http://pecl.php.net/package/apc£©
APCʵÏÖ·½·¨£º
°²×°APC£¬²ÎÕÕ¹Ù·½Îĵµ°²×°£¬¿ÉÒÔʹÓÃPECLÄ£¿é°²×°·½·¨¿ìËÙ¼ò½Ý£¬ÕâÀﲻ˵Ã÷
ÅäÖÃphp.ini£¬ÉèÖòÎÊý apc.rfc1867=1 £¬Ê¹APCÖ§³ÖÉÏ´«½ø¶ÈÌõ¹¦ÄÜ£¬ÔÚAPCÔ´Âë˵Ã÷ÎĵµÀïÃæÓÐ˵Ã÷
´úÂë·¶Àý£º
¸´ÖÆPHPÄÚÈݵ½¼ôÌù°å
PHP´úÂë:
if
($_SERVER[‘REQUEST_METHOD‘] == ‘POST‘)
{
//ÉÏ´«ÇëÇó
$status = apc_fetch(‘upload_‘ . $_POST[‘APC_UPLOAD_PROGRESS‘]);
$status[‘done‘] = 1;
echo
json_encode($status); //Êä³ö¸øÓû§¶ËÒ³ÃæÀïµÄajaxµ÷Óã¬Ïà¹ØÎĵµÇë×Ô¼ºÑ°ÕÒ
exit;
}
elseif
(isset($_GET[‘progress_key‘]))
{
//¶ÁÈ¡ÉÏ´«½ø¶È
$status = apc_fetch(‘upload_‘.$_GET[‘progress_key‘]);
echo
json_encode($status);
exit;
}
else
{
//ÆäËû´úÂ룬±ÈÈçÉÏ´«±íµ¥µÈ
}
2.ʹÓÃPECLÀ©Õ¹Ä£¿éuploadprogressʵÏÖ£¨http://pecl.php.net/package/uploadprogress£©
uploadprogress Ä£¿éʵÏÖ·½·¨£º
ʹÓÃPECLÄ£¿é°²×°·½·¨°²×°¸ÃÄ£¿é
php.iniÀïÃæÉèÖà uploadprogress.file.filename_template = “/tmp/upd_%s.txt”
´úÂë·¶Àý£º
¸´ÖÆPHPÄÚÈݵ½¼ôÌù°å
PHP´úÂë:
if($_SERVER[‘REQUEST_METHOD‘]==‘POST‘)
{
if
(is_uploaded_file($_FILES[‘upfile‘][‘tmp_name‘]))
{
$upload_dir = ‘your_path/‘;
$ext = strrchr($_FILES[‘video‘][‘name‘], ‘.‘);
$sessid = $_POST[‘UPLOAD_IDENTIFIER‘] ;
$tmpfile = $upload_dir . $sessid;
$sessfile &nb
Ïà¹ØÎĵµ£º
ÏÈ¿´¿´Ï±ßÕâ¶ÎPHP´úÂë¡£Õâ¶ÎʹÓÃip2longº¯Êý£¬¶Ôͬһ¸öIP½øÐÐת»»¡£µ±È»£¬Ò²ÓÐÈËÈÏΪ58.99.011.1ºÍ058.99.011.1Ëã²»ÉϺϷ¨µÄ
IP£¬ÄǾÍReturn£¬´ËÎĶÔÄãûÓаïÖú¡£
ΪʲôҪʹÓôøÇ°µ¼ÁãµÄip£ºÎªÁËÔÚÊý¾Ý¿âÖвéѯ£¬Õâ¸ö¿ÉÒÔÔÚIP¿âÖж¨Î»µ½ipËù¶ÔÓ¦µÄλÖÃÐÅÏ¢¡£ËäȻûÓÐÕûÐ͵ÄIP²éѯЧÂʸߣ¬µ«±Ï¾¹Ö±¹Û°¡¡£
view ......
ÏÖÔÚ»¹ÓкܶàÈ˸㲻¶®PHPºÍJAVA¿ª·¢µÄÐͬOAµ½µ×ÓÐʲô²»Í¬£¬¶Ô×Ô¼ºµ½µ×ÓÐʲôӰÏ죬ÒÔÖÁÓÚ×ö³öÁË´íÎóµÄÑ¡Ôñ¶øêݺ¦ÎÞÇî¡£±ÊÕ߸ù¾ÝÁ½ÖÖ¼¼ÊõµÄÌصãÖØÐÂÕûÀíÁËÒ»¸ö¶Ô±È£¬¸ø¹ØÐÄÐͬOA¼¼ÊõµÄ¶ÁÕß×ö¸ö²Î¿¼¡£
»ªÌ춯Á¦ÐͬOAÊDzÉÓÃJAVA¼¼ÊõµÄµäÐÍ´ú±í£¬²¢¾ßÓÐһϵÁÐÓÅ»¯É ......
¹úÇ쳤¼Ù½«ÖÁ£¬ÕæÊÇ¿ªÐÄ¡£ÕâÁ½ÌìÓеãС¿Õ£¬·ÒëÁËÊÖ²áÖеÄһЩÄÚÈÝ£¬ËãÊǸøPHPerÃǵÄÒ»¸öСÀñÎï¡£
±¾À´Ïë°ÑËùÓÐPHP5.3µÄÐÂÄÚÈݸø¸üÐÂÁË£¬µ«·¢ÏÖÊÖ²áÓкܴóµÄ¸Ä¶¯£¬ÓÈÆäÊÇһЩĿ¼½á¹¹Éϵķ¢¶¯¡£±ØÐëÏȸúÉÏÕâЩ¸Ä¶¯£¬·ñÔò±àÒë»á³ö´í£¬¸ü̸²»ÉϽøÒ»²½µÄ·Òë¡£
ÕâÁ½ÌìÖ÷Òª×öÁËÒÔϹ¤×÷£º
1. ½«·Òëƽ̨ǨÒƵ½SVN
PHP¹Ù·½µÄ ......
1¡¢¹ÅÀϵÄÆÛÆSQLÓï¾ä
ÔÚĬÈÏģʽÏ£¬¼´Ê¹ÊÇÄãÍüÁË°Ñphp.ini¿½µ½/usr/local/lib/php.iniÏ£¬php»¹ÊÇ´ò¿ªmagic_quotes_gpc=on¡£
ÕâÑùËùÓдÓGET/POST/CookieÀ´µÄ±äÁ¿µÄµ¥ÒýºÅ(')¡¢Ë«ÒýºÅ(")¡¢·´Ð±¸Übackslash(\)ÒÔ¼°¿Õ×ÖÔªNUL
(the null byte)¶¼»á±»¼ÓÉÏ·´Ð±¸Ü£¬ÒÔʹÊý¾Ý¿âÄܹ»ÕýÈ·²éѯ¡£
µ«ÊÇÔÚphp-4-RC2µÄʱºòÒýÈë ......