Emanating from the issue working on PHP Memory Limit is a need to further improve the documentation on drupal.org. A page has been added to provide instructions on how to amend the PHP memory limit: http://drupal.org/node/207036
This new page should be linked into the page http://drupal.org/requirements - a good place would appear to be at the end of:
PHP memory of 16MB or higher for a default Drupal 6 installation (8MB or higher may be sufficient for default installations of earlier versions). Depending on your site's use of custom or contributed modules, your PHP memory limit may need to be increased beyond 16MB.
by adding
Instructions for changing the PHP memory limit can be found in the <a href="http://drupal.org/node/207036"> Troubleshooting FAQ</a>
For reference a related issue:
http://drupal.org/node/206281
Comments
Comment #1
nancydruThanks for doing this page. I know one of the first things that will come up is "You said to put ... in my ... file, but WHERE?" Many of us know, or can figure out, where things should go, but many drupallers are afraid of messing with these files, so giving them an exact spot makes them feel better about doing it.
Comment #2
nancydruIn the introductory part, we should also include: "PHP 4 had a default of 8MB; PHP 5 has a default of 16MB, but your host may have changed this."
settings.php
If you scroll down, you will see a section labeled "PHP settings." Beneath this you will see several "ini_set" lines (directives). At the end of that list, add a new line that says:
Note that some sites may require a higher value.
php.ini
On many Windows systems, this file will be in the WINDOWS directory, so you may not be able to access it.
If you do have access, scroll down to see if there is a section labeled "Resource Limits." If so, there may already be a directive for the limit that you can edit. If not, add a line at the end of this section that says:
If there is no section already for this, place the above line at the end of the file.
Comment #3
nancydru.htaccess
There may already be sections (especially if you are using the file that came with Drupal) that say something like:
Locate the correct section for your version of PHP and Apache. (If you're not using Apache, consult with the appropriate manuals on how to do this.)
Preceding the closing "," add a line that reads:
I will be happy to make these changes to the page if there is agreement.
Comment #4
scor commentedI'm not sure it helps to add this. The default settings depends on how your PHP is packaged. On MAMP for example, PHP5 has 8MB by default, on debian I think it's 128MB. It varies, and there is no such general rule.
can you elaborate on this? In which circumstances aren't able to access php.ini on Windows?
re .htaccess, I think we could gain in simplicity by adding the line at the beginning of the Override PHP settings section, just before the 3 IfModule blocks. Otherwise, it becomes quite complex for the newbie to find which version PHP and Apache they are using. At least this way you are sure that the setting you add is applied, and if for some reason it doesn't work, you'll know it right away on your site.
Comment #5
nancydruPHP default: That is true. These figures are from the PHP manual. If this is superfluous, we can delete it.
Windows: I doubt seriously if a shared Windows host is going to let any user update the Windows directory... If it's their own PC, they can probably do anything they want.
.htaccess: If they put it at the top and there is another directive later on that lowers it, haven't they wasted their time?
Comment #6
scor commented.htaccess: well, in the default .htaccess shipped with Drupal there isn't such memory_limit rule, so it's ok. If there is already such rule in the file, it means they modified the file earlier, so we can almost assume they know what they are doing.
Comment #7
vjordan commentedAs I mentioned in the original post, we need to forward-link to this page from http://drupal.org/requirements
Furthermore I suggest some edits to the page:
Introduction
A PHP memory limit of 16MB is required for Drupal 6. Some sites may need more than 16MB if they are using many contributed modules. There are several techniques to increase the PHP memory limit and you only need to use one of them. The right one for you depends on your system configuration.
php.ini
This is the recommended approach if you have access to php.ini. This may not be possible in many shared hosting environments. Note that this change will affect all websites and PHP scripts on the server.
phpinfo()PHP function to find it. During installation Drupal checks the PHP Memory Limit and if it is less than 16M an error message also provides the path to the php.ini file..htaccess
Edit the .htacess file in the Drupal root directory. Look for the section:
and immediately after this add the following line:
settings.php
If Drupal is already installed, you can edit sites/default/settings.php
Locate the PHP settings section and add the line
Other cases
In some shared hosting environments, access to the PHP memory limit setting is restricted. If you cannot make the change yourself, please ask your hosting provider to adjust it for you.
Comment #8
nancydruLooks pretty good. I suspect a few very tentative folks are still going to post "exactly where..."
Comment #9
scor commentedthanks nancyw and vjordan for your constructive feedback. I merged them and updated the page: http://drupal.org/node/207036
I kept the option to change host at the end. More feedback/edit welcome.
Comment #10
nancydruLooks much better.
I just had a thought though. It says, "Some sites may need more than 16MB..." and the "php.ini" section states, "this change will affect all ... on the server." So perhaps, at the end of that section, and above ".htaccess" there should be a line that says something like, "The next two solutions are site-specific and, in some cases, may be more appropriate choices."
This is for those who have several sites, most of which run just fine in 16M, but one is glutted by many modules or even one module that needs a lot of memory (I have a module like that).
Comment #11
scor commentedthanks nancyw, updated.
Comment #12
vjordan commentedActually, the .htaccess modification applies to all sites for that Drupal multi-site installation. The settings modification is the only one that is 'site specific'. As it immediately begs the question "which cases" I would leave that line out. Or if it's really necessary connect it with the earlier explanation:
@scor: Nitpicking - I think the code sections would be clearer if you include a CR before the closing /code tag; it adds a box border and is then consistent with the two-line section.
Either or you have the permissions to modify http://drupal.org/requirements ?
Comment #13
nancydruYes, I can modify it.
".htaccess" - affects only the sites within this [multi-site] installation.
"settings.php" - affects only the site using this file.
Comment #14
keith.smith commentedI added this:
to the requirements page.
Comment #15
nancydruThanks
Comment #16
vjordan commentedLooks like all the key stuff is done. Chances are we'll get comments added to the FAQ page for specific cases not covered and in due course they can be integrated into the page content.
Thanks to all here.
Comment #17
Anonymous (not verified) commentedAutomatically closed -- issue fixed for two weeks with no activity.