0

我不知道为什么我的网站给我这个错误。这是错误列表。请盖住我!我该怎么办 ?

Fatal error: Out of memory (allocated 6029312) (tried to allocate 8192 bytes) in /home/lifegat/domains/life-gate.ir/public_html/includes/functions.php on line 7216


Fatal error: Out of memory (allocated 7602176) (tried to allocate 1245184 bytes) in /home/lifegat/domains/life-gate.ir/public_html/misc.php(89) : eval()'d code on line 1534


Fatal error: Out of memory (allocated 786432) (tried to allocate 1245184 bytes) in /home/lifegat/domains/life-gate.ir/public_html/showthread.php on line 1789



Fatal error: Out of memory (allocated 7340032) (tried to allocate 30201 bytes) in /home/lifegat/domains/life-gate.ir/public_html/includes/class_core.php(4633) : eval()'d code on line 627



Fatal error: Out of memory (allocated 2097152) (tried to allocate 77824 bytes) in /home/lifegat/domains/life-gate.ir/public_html/includes/functions.php on line 2550





Warning: mysql_query() [function.mysql-query]: Unable to save result set in [path]/includes/class_core.php on line 417

Warning: Cannot modify header information - headers already sent by (output started at [path]/includes/class_core.php:5615) in [path]/includes/functions.php on line 4513

数据库错误

Fatal error: Out of memory (allocated 786432) (tried to allocate 311296 bytes) in /home/lifegat/domains/life-gate.ir/public_html/includes/init.php on line 552

Fatal error: Out of memory (allocated 3145728) (tried to allocate 19456 bytes) in /home/lifegat/domains/life-gate.ir/public_html/includes/functions.php on line 8989




Fatal error: Out of memory (allocated 262144) (tried to allocate 311296 bytes) in /home/lifegat/domains/life-gate.ir/public_html/forum.php on line 475



Warning: mysql_query() [function.mysql-query]: Unable to save result set in [path]/includes/class_core.php on line 417

Warning: Cannot modify header information - headers already sent by (output started at [path]/includes/class_core.php:5615) in [path]/includes/functions.php on line 4513 
4

2 回答 2

1

Fatal error: Out of memory means that the server is out of reserved memory. This usually happens when you are working with big objects, such as images.

The solution is to use the & operator. This makes a variable point towards another object. Example:

$object = new BigObject();
$copy = $object;              // this copies the object thus more memory is required
$pointer = &$object;          // the & makes the $pointer variable point to $object

Because the variable is pointed to another variable, if you change one, the other will change as well.

$object = new BigObject();
$pointer = &$object;

$object->x = 12345;

echo $object->x;
echo $pointer->x; // will have the same output as $object->x

Pointers are often used in functions, like this:

$object = new BigObject();
x( $object );


function x( &$object ) {
     // do stuff with $object
}

The Warning: Cannot modify header information warning is usually given when you are trying to change the header data after sending output. You probably have a header(); call after you have echo'd something or have some whitespaces before you use the PHP open tag <?php.

Finally, the Warning: mysql_query() [function.mysql-query]: Unable to save result set error is usually a MySQL issue. But knowing you are out of memory, you might fix the other errors first.

于 2012-06-12T10:26:20.853 回答
0

增加或精简您的代码memory_limitphp.ini

于 2012-06-12T10:23:30.467 回答