PHPʹÓÃÊý¾Ý¿âÓÀ¾ÃÁ¬½Ó·½Ê½²Ù×÷MySQLµÄÊÇÓë·Ç
PHP³ÌÐòÔ±Ó¦¸Ã¶¼ÖªµÀÁ¬½ÓMySQLÊý¾Ý¿â¿ÉÒÔʹÓÃmysql_pconnect£¨ÓÀ¾ÃÁ¬½Ó£©º¯Êý£¬Ê¹ÓÃÊý¾Ý¿âÓÀ¾ÃÁ¬½Ó¿ÉÒÔÌá¸ßЧÂÊ£¬µ«ÊÇʵ¼ÊÓ¦ÓÃÖÐÊý¾Ý¿âÓÀ¾ÃÁ¬½ÓÍùÍù»áµ¼Ö³öÏÖһЩÎÊÌ⣬ͨ³£µÄ±íÏÖ¾ÍÊÇÔÚ´ó·ÃÎÊÁ¿µÄÍøÕ¾ÉÏʱ³£·¢Éú¶Ï¶ÏÐøÐøµÄÎÞ·¨Á¬½ÓÊý¾Ý¿âµÄÇé¿ö£¬³öÏÖÀàËÆ£¢Too many connections in ...£¢µÄ´íÎóÌáʾÐÅÏ¢£¬ÖØÐÂÆô¶¯·þÎñÆ÷ÓÖÕý³£ÁË£¬µ«¹ý²»ÁËÒ»»á¶ùÓÖ³öÏÖͬÑùµÄ¹ÊÕÏ¡£¶ÔÓÚÕâЩÎÊÌâµÄ³ÉÒò£¬¿ÖžͲ»ÊÇÿ¸öÈ˶¼ÄÜ˵Çå³þµÄÁË£¬ËäÈ»PHPÎĵµÀïÓÐһЩÏà¹Ø×ÊÁÏ£¬µ«ÊǽâÊ͵IJ¢²»Ç³ÏÔÒ׶®£¬ÕâÀïÎÒºñ×ÅÁ³Æ¤ÊÔͼ×öÒ»¸ö¼òµ¥µÄÌÖÂÛ£¬ËùÊö¹Ûµã²»¼ûµÃÈ«¶¼ÕýÈ·£¬»¶Ó´ó¼Ò·´À¡Òâ¼û¡£
Ê×ÏÈ¿´¿´Êý¾Ý¿âÓÀ¾ÃÁ¬½ÓµÄ¶¨Ò壺
ÓÀ¾ÃµÄÊý¾Ý¿âÁ¬½ÓÊÇÖ¸Ôڽű¾½áÊøÔËÐÐʱ²»¹Ø±ÕµÄÁ¬½Ó¡£µ±ÊÕµ½Ò»¸öÓÀ¾ÃÁ¬½ÓµÄÇëÇóʱ¡£PHP ½«¼ì²éÊÇ·ñÒѾ´æÔÚÒ»¸ö£¨Ç°ÃæÒѾ¿ªÆôµÄ£©ÏàͬµÄÓÀ¾ÃÁ¬½Ó¡£Èç¹û´æÔÚ£¬½«Ö±½ÓʹÓÃÕâ¸öÁ¬½Ó£»Èç¹û²»´æÔÚ£¬Ôò½¨Á¢Ò»¸öеÄÁ¬½Ó¡£Ëùν“Ïàͬ”µÄÁ¬½ÓÊÇÖ¸ÓÃÏàͬµÄÓû§ÃûºÍÃÜÂëµ½ÏàͬÖ÷»úµÄÁ¬½Ó¡£
PHPʹÓÃÓÀ¾ÃÁ¬½Ó·½Ê½²Ù×÷MySQLÊÇÓÐÇ°ÌáµÄ£º¾ÍÊÇPHP±ØÐ밲װΪ¶àÏ̻߳ò¶à½ø³ÌWeb·þÎñÆ÷µÄ²å¼þ»òÄ£¿é¡£×î³£¼ûµÄÐÎʽÊÇ°ÑPHPÓÃ×÷¶à½ø³ÌApache·þÎñÆ÷µÄÒ»¸öÄ£¿é¡£¶ÔÓÚÒ»¸ö¶à½ø³ÌµÄ·þÎñÆ÷£¬ÆäµäÐÍÌØÕ÷ÊÇÓÐÒ»¸ö¸¸½ø³ÌºÍÒ»×é×Ó½ø³Ìе÷ÔËÐУ¬ÆäÖÐʵ¼ÊÉú³ÉWebÒ³ÃæµÄÊÇ×Ó½ø³Ì¡£Ã¿µ±¿Í»§¶ËÏò¸¸½ø³ÌÌá³öÇëÇóʱ£¬¸ÃÇëÇó»á±»´«µÝ¸ø»¹Ã»Óб»ÆäËüµÄ¿Í»§¶ËÇëÇóÕ¼ÓõÄ×Ó½ø³Ì¡£ÕâÒ²¾ÍÊÇ˵µ±ÏàͬµÄ¿Í»§¶ËµÚ¶þ´ÎÏò·þÎñ¶ËÌá³öÇëÇóʱ£¬Ëü½«ÓпÉÄܱ»Ò»¸ö²»Í¬µÄ×Ó½ø³ÌÀ´´¦Àí¡£ÔÚ¿ªÆôÁËÒ»¸öÓÀ¾ÃÁ¬½Óºó£¬ËùÓв»Í¬×Ó½ø³ÌÇëÇóSQL·þÎñµÄºó¼ÌÒ³Ã涼Äܹ»ÖØÐÂʹÓÃÕâ¸öÒѾ½¨Á¢µÄ SQL·þÎñÆ÷Á¬½Ó¡£ËüʹµÃÿ¸ö×Ó½ø³ÌÔÚÆäÉúÃüÖÜÆÚÖÐÖ»×öÒ»´ÎÁ¬½Ó²Ù×÷£¬¶ø·Çÿ´ÎÔÚ´¦ÀíÒ»¸öÒ³Ãæʱ¶¼ÒªÏò SQL ·þÎñÆ÷Ìá³öÁ¬½ÓÇëÇó¡£Ã¿¸ö×Ó½ø³Ì½«¶Ô·þÎñÆ÷½¨Á¢¸÷×Ô¶ÀÁ¢µÄÓÀ¾ÃÁ¬½Ó¡£PHP±¾Éí²¢Ã»ÓÐÊý¾Ý¿âÁ¬½Ó³ØµÄ¸ÅÄµ«ÊÇApacheÓнø³Ì³ØµÄ¸ÅÄî, Ò»¸öApache×Ó½ø³Ì½áÊøºó»á±»·Å»Ø½ø³Ì³Ø, ÕâÒ²¾ÍʹµÃÓÃmysql_pconnect´ò¿ªµÄµÄÄǸömysqlÁ¬½Ó×ÊÔ´¿ÉÒÔ²»±»ÊÍ·Å£¬¶øÊÇÒÀ¸½ÔÚÏàÓ¦µÄApache×Ó½ø³ÌÉϱ£´æµ½Á˽ø³Ì³ØÖС£ÓÚÊÇÔÚÏÂÒ»¸öÁ¬½ÓÇëÇóʱËü¾Í¿ÉÒÔ±»¸´Óá£Ò»Çп´ÆðÀ´Ëƺõ¶¼ºÜÕý³££¬µ«ÊÇÔÚApache²¢·¢·ÃÎÊÁ¿´óµÄʱºò£¬Èç¹ûʹÓÃmysql_pconnect£¬»áÓÉÓÚ֮ǰµÄ Apache×Ó½ø³ÌÕ¼ÓõÄMySQLÁ¬½ÓûÓÐclose, ºÜ¿ìʹMySQL´ïµ½×î´óÁ¬½ÓÊý£¬Ê¹µÃÖ®ºóµÄÇëÇó¿ÉÄܵò»µ½ÏìÓ¦¡£
ÉÏÃæµÄ²¿·ÖÎÄ×ÖÊÇÕª³×ÔPHPÎĵµ£¬¿´ÆðÀ´¿ÉÄÜ»¹ÊÇÓÐЩÎÄç§ç§µÄ²»ºÃÀí½
Ïà¹ØÎĵµ£º
À´Ô´: ChinaUnix²©¿Í ¡¡ÈÕÆÚ£º 2008.04.28 12:29¡¡(¹²ÓÐ0ÌõÆÀÂÛ) ÎÒÒªÆÀÂÛ
ÊÇÓÃmysqlµÄʱºò£¬×Ö·û±àÂëÊǸö´óÎÊÌ⣬ÎÒһֱʹÓÃutf8µÄ±àÂ룬»ù±¾ÉÏûʲô´óÎÊÌ⣬¾ÍÊÇÿ´ÎÆô¶¯mysqlµÄʱºò¶¼ÐèÒªÉèÖÃһϣ¬mysql£¬Ê±¼ä³¤ÁË£¬Ò²¹ÖÂé·³µÄ£¬ÔÚÍøÉÏËÑÁËһϣ¬·¢ÏÖÏÂÃæµÄ·½·¨ÄÜÍêÈ«½â¾öÕâ¸öÎÊÌ⣬µ±È»Èç¹ûÊÇ×Ô¼º±àÒëµÄmy ......
¡¡¡¡ÎÒ¿ª·¢µÄСվ£ºhttp://www.asprain.com£¬»¶Ó¹ÛĦ¡¢ÌåÑ飡
¡¡¡¡°¡£¬½ñÌì¿´µ½ºÜ¶àÈË˵ÎÒÂîPHP³ÌÐòÔ±ÊÇÔÚ³´×÷£¬Ä¿µÄÊÇÍƹãÎÒµÄÂÛ̳³ÌÐò¡£»°Ëµ£¬ËäÈ»ÎÒ֮ǰһֱºÜÏëÏë°ì·¨Ìá¸ß×Ô¼ºÐ´µÄÄǸö³ÌÐòµÄÖªÃû¶È¡£ÎÒ°ÑÎÒµÄСվ½éÉܸøÎÒµÄËùÓеĺÃÓÑ£¬ÇëËûÃÇ¿Ú¿ÚÏà´«¡£µ«ÊÇÎÒȷʵдÕâƪÎÄÕÂÊÇûÓг´×÷Ä¿µÄµÄ¡£ÔÒòºÜ¼òµ¥£ºÎÒÐ ......
´ËÎÄյݲװ·½·¨ÊÊÓÃÓÚWindows XPϵÄApache+PHP+MySQL°²×°¡£ 1. °²×°»·¾³
²Ù×÷ϵͳÊÇ Windows XP ÖÐÎÄ°æ, Apache, PHP, MySQL µÄ×îа汾ÊǽØÖ¹µ½ 2007.09.07£¬·Ö±ðÔÚÆä¹ÙÍøÏÂÔصÄ:
* Apache 2.2.6£ºhttp://apache.mirror.phpchina.com/httpd/binaries/win32/
* PHP 5.2.4 (Windows Binaries PHP 5.2.4 z ......
<?php
$url="ÕâÀïдÇëÇóµØÖ·";//http://pmtest.webgame.com.cn/d.php
$data="ÕâÀïдpostÊý¾Ý";//Èç:a=123&b=456 ±íʾ´«Á½¸ö²ÎÊýaºÍb
$rfr="·¢³öÊý¾ÝµÄÒ³ÃæµÄµØÖ·";
$cookie="ÕâÀïдcookie";//Èç:PHPSESSIDs=123456; b=11212
/*
Àý×Ó:
$rfr="http://*.c ......