I have changed my php.ini "memory_limits" directive, googled on drupal.org and more, spoken with my hosting provider (more than once), run the devel module stats, read the PHP manual regarding memory limits, even tried adjusting it in .htaccess, but I cannot load the Module listing page (admin/build/modules/list) without getting the error:
Fatal error: Out of memory (allocated 53215232) (tried to allocate xxxx bytes) in xx/yyy/sss
My hosting provider, Bluehost, says that they allow a limit of 128M, which should be more than enough, especially as I never seem to get an error that reports more than 53215232 bytes. The Devel Module generally reports a max memory usage at script end of about 43MB, but to be perfectly frank, and don't know exactly how that correlates.
I have also tried using PHP5 single, and multiple, and placed my PHP.ini file where required; both end in the same result.
Could there be a script elsewhere that is limiting the memory usage? Do modules ever do that?
I am running the most current versions of several contributed modules, but they all seem to be fairly standard:
Views2
Calendar
CiviCRM
Advanced Forum + abuse, author pane, comment subject
Advanced Help
CCK + date, email, filefield
fckEditor
Pathauto + token
devel
This is such a deal-breaker, and I can't tell if it's Drupal, a contributed module, or my host. Thanks!
jgaryt
Comments
I'd create a php page that
I'd create a php page that looks like this:
Then load the file in your browser. It should output all the details of your PHP configuration, including your memory_limit settings.
It will show where PHP is looking for your php.ini file. Make sure that is the file that is configured correctly. I hope this helps.
Look there -> /admin/reports/status
In Drupal 6, the Status Report (/admin/reports/status) have a line listing the PHP Memory Limit. From the error message you got, I would be surprised to see the PHP Memory Limit at 128M.
Please note that you can override the memory limit in the .htaccess file.
/*_*/
http://www.xmacinfo.com
admin/reports/status
thanks to everyone for the advice! My status report shows 128M, and the PHP.ini is being read from exactly where I expect it to be "/home1/mylogin/public_html/staging/php.ini ". (Staging is a sub-domain so it's in the root of that sub-domain).
Here's a screen cap of my status report and my phpinfo
http://img21.imageshack.us/my.php?image=drupaladminreport657130cd5.jpg
http://img519.imageshack.us/my.php?image=drupalmemlimitka3.png
So, if all is well with PHP, what's stopping the Modules from loading?
jgaryt
Update to original challenge
So, as I was completely at a loss, and was itching to do something as I had just finished a quad espresso...I migrated the whole Drupal site to my local WAMP server. That was a learning process too...especially with CiviCRM.
BUT....
The whole site works without a flaw. Memory_Limit set to 128M, and no changes to any files other than pointers to databases etc.
Guess I'll get on the phone with BlueHost...wish me luck.
-
jgaryt
Solved - Hitting Hard Memory Limit - BlueHost not telling truth.
well, after *several* rounds of communication with Bluehost, one of which I was told to "find another web host" even though I am still in the staging phase of the site and have no users, the truth finally came out. A level 1 technician sent me this explanation:
So, they say that they allow a PHP Memory_Limit of 128M, but that's simply not true.
Is anyone running a large Drupal site on a shared hosting environment that will allow a true 128M limit? We are investigating our options for dedicated servers, but that's a little way off into the future.
-
jgaryt
I encountered something
I encountered something similar in hostgator. They have set PHP memory_limit to 64M by default. Drupal's admin/reports/status page agrees that it is 64M. However, admin/build/modules gives me a blank page and PHP logs "PHP Fatal error: Out of memory (allocated 41418752) (tried to allocate nn bytes)". The obvious question is "why 40M"?
I got an answer saying that the cause is that I have hit one of Apache's limits, which are:
RLimitMEM 83886080 104857600 (which covers all Apache memory needs)
RLimitCPU 150 200
RLimitNPROC 25 30
Of course what interests me here is what that means in practice. If, as I suspect, Apache is never going to allow more than 40M PHP memory, then the 64M setting is meaningless, hence misleading. I am still talking with tech support (in case the limit is the CPU or the number of processes).
--------- An update:
I verified that in my case, with php memory_limit=64M and with RLimitMEM set to 80M in Apache, only about 40M were left for php web scripts:
Output:
Probably only an non-web php script can use all 64M of php memory.
They agreed to raise the RLimitMEM for a subdomain and it did work.
Different results with different Hostgator IPs
I run the script on Hostgator which I have an account with reseller aluminium then I got same result. It's giving error if I pass around 40M:
But their SEO hosting has different results with different IPs. I thought these are on different servers but it isn't. Here it is 5 different domain:
UPDATE:
This one fixed by one of HG system admin with the comment of
Problem with views?
I'm getting the same problem the moment I select civicrm in admin/build/modules . Here is the complete error:
Maybe it has something to do with Views2.
Creating a page using the following script gave me my php config info, which shows php.inin out of public_html:
My call to bluehost got a helpful, knowledgeable support guy who confirmed that my installation was picking up the 128m. He questioned whether Drupal was looking at a different 32M limit.
Tom Stermitz, Denver Colorado
To see the memory_limit which
To see the memory_limit which Drupal is actually picking you can
- check the admin/reports/status page (in Drupal 6)
- run
<?php phpinfo(); ?>inside a Drupal post using the "PHP code" input format (in Drupal 5).The error message says that it hit a memory limit of about 50M, which may be due to the RLimitMEM settings in Apache that I mentioned.
The simple script which I used above was my natural response when I was given the "Contact Drupal's technical support" speech. I said "Hey, forget about Drupal and try this instead".
Well, now it's automagically working
I had a browser open to /admin/modules in another computer, so I went there and turned off a bunch of modules, and selected CiviCRM again. I'm not sure that anything I did actually addressed the problem, but now I'm not getting the error.
It is well-advised to leave a separate browser open to the modules window so you can recover... turning off modules if you have to.
Tom Stermitz, Denver Colorado
Bluehost finally confirmed server limit
I think they are getting more calls on this issue. The last support guy immediately knew what I was talking about, and confirmed that they won't go to 128M. He got irritated when I pushed him to ask management to consider lifting the limit. I'm not going to blame him for being caught between me and Corporate policy, and frankly, Bluehost is a bit higher than others, not to mention the fact that I've always got good service from them.
ANhosting tech support claimed 20M and their sales guy said definitively 12M... Either of those are low for Drupal, and ANhosting claims to be good Drupal support people.
On the Drupal and CiviCRM side, the developers need to be careful of memory usage.
On the hosting side, we need ratings on php memory_limits for the different hosts. It is a competitive world. If a hosting company gets a reputation for not delivering the services that Drupal requires, they could lose a whole class of webdesigners.
Tom Stermitz, Denver Colorado
Bad news indeed
I'm finding this thread very interesting, thanks for all of the great info. I now understand why I'm getting the error even though my php memory limit is 96M.
I am in the process of setting up a Drupal site with Civicrm on Bluehost and I too am having memory issues. The bad part is I just signed up for a Bluehost SSL cert and a dedicated IP in order to accept credit card payments directly though my site. Any ideas on how to get around the memory issue without switching to another host? Thanks for any help!
PS my site is https://www.aadmd.org
Without switching host? If
Without switching host? If their sales dept. doesn't offer a better hosting plan and if they won't negotiate then the only thing you can do is restrict your memory needs. 96M of PHP memory is something which is not generally available to most shared hosting plans.
You could try disabling some modules. Or, if you need the memory for image manipulation, try restricting the allowed image upload size. Or try imagemagick instead of GD, in case memory consumption of external programs doesn't count.
But if you really need the memory, try a $20/month VPS hosting plan.
Thanks
Thanks for the suggestions, I'm looking into reducing my memory usage. I wasn't having a problem before Civicrm, so I'm starting there and seeing what can be tweaked. As far as i can calculate, I need about 65M for it to work right now and I'm hitting the Bluehost wall at about 61M. Hopefully a little tweaking does the job.
-John Hood
Bluehost relaxing limits
After taking over a project whose hosting has been under Bluehost, I was bracing myself for a difficult support call when I ran into the PHP memory limit issue. Looks like BH has relaxed their policy a bit since some of the posts above, because I was able to allocate 96M with no problems.
The support guy referred me to a cPanel tool where the customer can opt for a single user-controlled php.ini file that gets generated on the fly in the root of your site at the click of a button. The customer can then edit that as they see fit, and then rename to php.ini once it's ready.