A list of error in my site

I don't know why my site give me this error. This is the list of errors. plz lid me ! what shall i do ?

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

Database error

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 

Answers


Increase memory_limit in php.ini or slim your code.


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.


Need Your Help

T-SQL Triggers performing insert causing deadlock

sql-server triggers deadlock

I have an SQL table called Agent_Events, which logs "jobs" for lack of a better term reported by users of our system. Jobs will start and, some indetermine time later, end. We want to keep a record...

Pull down to refresh in Windows Phone 8.1

c# listview windows-runtime windows-phone-8.1 pull-to-refresh

I want to implement the pull-down-to-refresh function in my WP8.1 (Runtime) app. I tried to find a solution for this WP version, but as I have seen this function works in older versions of WP.