Try increasing or removing memory_limit in php.ini .
Find something like this and change the value of memory_limit
; Maximum amount of memory a script may consume (128MB) ; http:
(this is part of my php.ini)
Reboot the server after saving the changes.
Alternatively, you can try to remove the restriction from the code.
Example:
ini_set('memory_limit', '-1');
This should work fine.
Another way is to set the memory limit from the .htaccess file by adding the line:
php_value memory_limit 128M
(128M is just an example)
Note. For shared hosting, I doubt very much that you can change the memory limit.
source share