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

½â¾öPHPÄÚ´æÒç³öµÄÎÊÌâ

Allowed memory size of 33554432 bytes exhausted (tried to allocate 4554 bytes)
      ÓÐʱºòÎÒÃÇÔÚÔËÐÐphp³ÌÐòµÄʱºò»á·¢ÏÖ Fatal Error: Out of memory ÕâÑùµÄÌáʾ¡£ ÕâÓпÉÄÜÊdzÌÐòÖÐÓõ½ÁË´óÁ¿Á˱äÁ¿ºÍ¶ÔÏ󣬵¼Ö·ÖÅäµÄÄÚ´æ²»¹»Óá£ÎÒ¾ÍÓöµ½ÕâÑùÒ»¸ö´íÎóÔõô¸ÄÒ²¸Ä²»ÁË£¬ºóÀ´ÉÏÍø²éÁËһЩ×ÊÁÏ£¬¿ÉÊÇÐÞ¸ÄÁËphp.iniÎļþÀïµÄmemory_limit²ÎÊý£¬¿ÉÊÇÎÞÂÛÎÒÔõô¸Ä»¹ÊÇÓÐÕâ¸ö´íÎóÌáʾ£¬ÌرðÓôÃÆ£¡ºóÀ´ÎÒʵÔÚûÓа취ÁË£¬¾ÍÔÚQQȺÀïÃæÇóÖú£¬ÓÐÈ˸æËßÎÒÔÚÎҵijÌÐò´úÂëÖмÓÈë“init_set("memory_limit", "128M");”ÕâÐдúÂë¾Í¿ÉÒÔÁË£¬ÓÚÊÇÎÒÊÔÁËһϣ¬»¹ÕæµÄÐÐÁË¡£ÏÖÔÚÎÒ°Ñ×Ô¼º½â¾öÕâ¸öÎÊÌâµÄÁ½ÖÖ°ì·¨·ÖÏí¸ø´ó¼Ò£¬Ï£ÍûÄܰﵽºÍÎÒÒ»ÑùÓöµ½ÀàËÆÎÊÌâµÄÈËÃÇ¡£
·½·¨Ò»£ºÎÒÃÇ¿ÉÒÔÔÚphp.iniÎļþÖаÑmemory_limit²ÎÊýĬÈϵÄ128MÐÞ¸ÄΪ256M»òÕ߸ü´ó£º
memory_limit = 128M
·½·¨¶þ£ºÈç¹ûÊÇÐéÄâÖ÷»ú£¬ÎÒÃÇ¿ÉÒÔÔÚ³ÌÐòÐèÒªÓõ½´óÄÚ´æµÄµØ·½Ìí¼Ó£º
init_set("memory_limit", "128M");
ÕâЩ¿ÉÒÔÔÚÓ²¼þ»·¾³·½Ãæ½â¾öÎÒÃǵÄÎÊÌ⣬²»¹ý×îºÃµÄ·½·¨»¹ÊÇÑϸñ¿ØÖƳÌÐòÖÐÄÚ´æµÄËðºÄ¡£¼°Ê±unsetһЩ´ó¶ø²»ÓõıäÁ¿»ò¶ÔÏó¡£


Ïà¹ØÎĵµ£º

PHPº¯Êý__autoload()ºÍspl_autoload_register()

__autoload($classname){
}
µ±PHPÕÒ²»µ½ÀàÎļþ»áµ÷ÓÃÕâ¸ö·½·¨£¬µ±×¢²áÁË×Ô¼ºµÄº¯Êý»ò·½·¨Ê±£¬PHP²»»áµ÷ÓÃ__autoload()º¯Êý£¬¶ø»áµ÷ÓÃ×Ô¶¨ÒåµÄº¯Êý
spl_autoload_register('func_name');
spl_autoload_register(array('class_name','method_name')); ......

phpÎļþÉÏ´«´úÂë

<html>
<head><title>ÎļþÉÏ´«</title></head>
<body alink="#FF0000" link="#000099" vlink="#CC6600" topmargin="8" leftmargin="0" bgColor="#FFFFCC">
<?php
if(!$_POST['upload'])
{
?>
<form enctype="multipart/form-data" action="upload.php" method="post"& ......

php¹ýÂËÌØÊâ×Ö·û

phpÌØÊâ×Ö·û¹ýÂË
1¡¢¹ýÂ˱êÇ©(HTML)£ºstrip_tags()
ÀýÈ磺
<?php
$text = '<?php ?><p>Test paragraph.</p><!-- Comment -
-> <a href=http://topic.csdn.net/u/20090311/09/"#fragment">Other text</a>';
echo strip_tags($text);
echo "\n";
// ÔÊÐíʹÓÃ<p>ºÍ< ......

WindowsXPËÑË÷PHP¡¢XMLµÈÎļþÄڵİüº¬ÎÄ×ÖµÄÉèÖ÷½·¨

µ±ÎÒÃÇÓÃWINDOWSËÑË÷ij°üº¬Ä³ÎÄ×ÖµÄÎļþʱ£¬¿ÉÒÔÔÚ“°üº¬ÎÄ×Ö”´¦ÌîÉÏËÑË÷´Ê¡£µ«ÊÇһЩ²»³£¼ûµÄºó׺ÃûÎļþWINDOWS²»»áËÑË÷£¬È磺£¬.log¡¢.dll¡¢.js¡¢.asp¡¢.xml¡¢.xsl¡¢.hta¡¢.css¡¢.wsh¡¢.cpp¡¢.c »ò .hµÈ¼°ÎÞºó׺ÃûµÄÎļþ¡£¶ÔÓÚÎҵȳÌÐò°®ºÃÕßÀ´ËµÊµÔÚÌ«²»·½±ãÁË£¬ËäÈ»ÓГÎı¾Ìæ»»´óʦ”µÈÈí¼þÄÜ×öÕ ......

PHP һЩ֪ʶ

1.È¡µÃµ±Ç°ÄÚ´æÊ¹ÓôóС£ºmemory_get_usage()
2.¼ÆËãÖ´ÐÐʱ¼ä£ºmicrotime(true)
3.ÉèÖÃscriptÖ´ÐÐʱ¼äÏÞÖÆset_time_limit
4.ÉèÖÃÄÚ´æÏÞÖÆini_set("memory_limit","256M");
3.´ÓÔ¶³ÌÏÂÔØÎļþµÄÁ½¸ö·½·¨£º
$contents=file_get_contents("http://www.govtrack.us/data/us/gis/zip4dist-prefix.t ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØÍ¼ | ¸ÓICP±¸09004571ºÅ