thinkphpÈ¥µôĬÈÏÏÞÖÆ
ÔÚʹÓÃthinkphp¿ò¼Ü¿ª·¢ÏîĿʱ£¬ÎÒÃÇ¿ÉÄܻᷢÃ÷ĬÈÏÇéÐÎÏ¿ò¼Ü»á¶ÔÉÏ´«Îļþ¾Þϸ¡¢±íµ¥Ìá½»Êý¾Ý¾ÞϸÒÔ¼°sqlÅÌÎÊЧ¹ûÌõÊýµÈ¾ÙÐÐÏÞÖÆ£¬Õâ¹ØÓÚһЩÐèÒªÉÏ´«´óÎļþ»òÕßÅÌÎÊ´óÊý¾ÝÁ¿µÄÏîÄ¿À´Ëµ»á´øÀ´ºÜ´óµÄÀ§ÈÅ¡£Òò´Ë£¬ÎÒÃÇÐèÒª¶ÔÕâЩĬÈÏÏÞÖƾÙÐÐÐ޸ĺÍÈ¥³ý¡£
È¥³ýÉÏ´«Îļþ¾ÞϸÏÞÖÆ
ÔÚthinkphp¿ò¼ÜÖУ¬ÉÏ´«Îļþ¾ÞϸµÄÏÞÖÆÊÇÓÉphp.iniÖеÄupload_max_filesizeºÍpost_max_sizeÀ´ÊµÏֵģ¬Òò´ËÎÒÃÇÐèÒªÐÞ¸Äphp.iniÎļþÖеÄÕâÁ½¸öÉèÖÃÏî¡£
Ê×ÏÈ£¬ÔÚÏÂÁîÐÐÖÐÊäÈëphp –ini£¬¿ÉÒÔÉó²éphp.iniÎļþµÄ·¾¶¡£ÕÒµ½¸ÃÎļþ²¢·¿ª£¬È»ºó¾ÙÐÐÈçÏÂÐ޸ģº
upload_max_filesize = 100M
post_max_size = 100M
ÆäÖÐ100M¿ÉÒÔƾ֤ÏîÄ¿ÐèÒª×ÔÐе÷½â¡£ÐÞ¸ÄÍê³Éºó£¬ÉúÑIJ¢ÖØÆôApache»òÕßNginxЧÀÍÆ÷¡£
Á¬Ã¦Ñ§Ï°¡°PHPÃâ·ÑѧϰÌõ¼Ç£¨ÉîÈ룩¡±£»
È¥³ý±íµ¥Ìá½»Êý¾Ý¾ÞϸÏÞÖÆ
ÔÚthinkphp¿ò¼ÜÖУ¬±íµ¥Ìá½»Êý¾Ý¾ÞϸµÄÏÞÖÆÊÇÓÉphp.iniÖеÄpost_max_sizeºÍmemory_limitÀ´ÊµÏֵģ¬Í¬ÑùÐèÒª¾ÙÐÐÐ޸ġ£ÔÚphp.iniÎļþÖÐÕÒµ½ÕâÁ½¸öÉèÖÃÏ²¢¾ÙÐÐÈçÏÂÐ޸ģº
post_max_size = 100M
memory_limit = 128M
ÆäÖÐ100M¿ÉÒÔƾ֤ÏîÄ¿ÐèÒª×ÔÐе÷½â¡£ÐÞ¸ÄÍê³Éºó£¬ÉúÑIJ¢ÖØÆôApache»òÕßNginxЧÀÍÆ÷¡£
Á¬Ã¦Ñ§Ï°¡°PHPÃâ·ÑѧϰÌõ¼Ç£¨ÉîÈ룩¡±£»
È¥³ýsqlÅÌÎÊЧ¹ûÌõÊýÏÞÖÆ
ÔÚthinkphp¿ò¼ÜÖУ¬sqlÅÌÎÊЧ¹ûÌõÊýµÄÏÞÖÆÊÇÓÉ¿ò¼Ü×ÔÉíÉ趨µÄ£¬Òò´ËÐèÒª¶Ô¿ò¼Ü´úÂë¾ÙÐÐÐ޸ġ£
ÔÚthinkphp¿ò¼ÜµÄ½¹µã´úÂëÎļþThinkPHPDbDriverPdo.phpÖУ¬¿ÉÒÔÕÒµ½ÒÔÏ´úÂ룺
if (isset($options[‘limit’])) {
$limit = is_numeric($options['limit']) ? $options['limit'] : 100000; $this->_queryStr .= ' LIMIT ' . $limit;
µÇ¼ºó¸´ÖÆ
}
ÆäÖÐ100000¼´ÎªÄ¬ÈϵÄÅÌÎÊЧ¹ûÌõÊýÏÞÖÆ¡£ÎÒÃÇ¿ÉÒÔ½«ÆäÐÞ¸ÄΪ¸ü´óµÄÊýÖµ»òÕ߸ÄΪ0ÌåÏÖ²»ÏÞÖÆÌõÊý¡£ÐÞ¸ÄÍê³Éºó£¬ÉúÑIJ¢ÖØÐÂÔËÐÐÏîÄ¿¼´¿É¡£
×ܽá
ͨ¹ý¶Ôphp.iniÉèÖÃÎļþÒÔ¼°thinkphp¿ò¼Ü´úÂëµÄÐ޸ģ¬ÎÒÃÇ¿ÉÒÔÈ¥³ýĬÈÏÏÞÖÆ£¬½â¾öһЩÉÏ´«´óÎļþ»òÕßÅÌÎÊ´óÊý¾ÝÁ¿µÄÏîÄ¿ÖеÄÀ§ÈÅ¡£ÐèҪעÖصÄÊÇ£¬ÔÚÐÞ¸ÄÉèÖÃÎļþʱ£¬ÒªÆ¾Ö¤ÏêϸÐèÇó¾ÙÐе÷½â£¬²»ÒªÉèÖùýÓÚÖØ´óµÄÊýÖµµ¼ÖÂЧÀÍÆ÷¼ç¸º¹ý´ó¡£
ÒÔÉϾÍÊÇthinkphpÈ¥µôĬÈÏÏÞÖƵÄÏêϸÄÚÈÝ£¬¸ü¶àÇë¹Ø×¢±¾ÍøÄÚÆäËüÏà¹ØÎÄÕ£¡