Php memory size exhausted error

If you are getting a php Fatal error like

Fatal error: Allowed memory size of 20971520 bytes exhausted at /usr/ports/lang/php5/work/php-5.2.1/Zend/zend_hash.c:1036 (tried to allocate 232 bytes) in /home2/webofunni/www/mediawiki-1.10.1/includes/SpecialPage.php on line 784

Then error is because of small memory limit in php. Try to increase php memory limit by following method .

1. Add following line to .htaccess

php_value memory_limit 32M

2. if that doesn’t work open php.ini and look for

memory_limit = XMwhere X is some number. Increase that number to higher value and try.

Here is a short explanation of memory_limit directive in php.ini

memory_limit integer ( default value 8M)

This sets the maximum amount of memory in bytes that a script is allowed to allocate. This helps prevent poorly written scripts for eating up all available memory on a server. In order to use this directive you must have enabled it at compile time. So, your configure line would have included: –enable-memory-limit. Note that you have to set it to -1 if you don’t want any limit for your memory
.

Both comments and pings are currently closed.

Comments are closed.