PHP how to increase memory

You are here

Increase memory using php.ini file

Increasing your memory for the Drupal Framework is important as this allows the application to work faster and then deliver the content to the user giving faster access to the content that you are providing. There are two ways to do this, if you have access to your php.ini file on your web server find the line that says the following.

memory_limit = 16M  ;

Most service providers will only allocate the default amount of 16 megabytes of ram. If  you change it to 64 megabytes of ram this will fix the issue.

memory_limit = 64M ; Maximum amount of memory a script may consume (64MB)

Increase PHP memory using a  htaccess directive

At times however the web hosting companies will not give you access to this file so you can change it using a htacess directve. To do this you need to find the file .htaccess, open it and and place the following code into the file. This will achieve the same goal as increasing the memory of your online application or website.

php_value memory_limit 64M;

This method will only work if the PHP engine is running as a module on Apache the only other option you have after that is talk to your webhosting provider or move to another host.