PHP Fatal error: Allowed memory size of x bytes exhausted (tried to allocate … bytes) in



I am getting "PHP Fatal error: Allowed memory size of 8388608 bytes exhausted (tried to allocate … bytes) in test.php" error in my php script. What does this error mean? How do I fix it?



Locate your php.ini which is your php configuration file and increase the parameter memory_limit to 32M or 64M. Restart apache and that should solve your problem.

I am on a shared hosting. Where is php.ini?

2 things, you can try:

1. Contact your hosting provider.
2. Try increasing this limit in your .htaccess files as follows and see if that works:
php_value memory_limit 64M