There are three ways to change memory_limit for your PHP script (s):
1) A quick fix is ββto add the following line to your .htaccess root directory:
php_value memory_limit 32M
2) In your PHP configuration file (php.ini) - Location depends on Apache / server settings. Find the file for memory_limit and change it to the desired value:
memory_limit= 32M
Then restart the Apache server.
3) You can also specify a memory limit in your PHP script:
ini_set('memory_limit', '32M');
source share