Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
By Wai_Wai on
Hi.
1) How to check if there's any upper limit of memory in my web hosting? If s, how much?
2) What is the best way to increase my memory limit?
There're 3 ways:
- php.ini
- index.php
- settings.php
Which one should I edit?
What're the pros and cons?
What code do I need to add (for each file separately)?
Thanks!
Comments
Any help?
Any help?
Admin - module not loading in Drupal - Memory Limit
If you run out of PHP memory. You'll need to either uninstall some modules or increase the memory_limit variable in php.ini.
/etc/php4/apache2/php.ini
; change from 8MB to 16MB
memory_limit = 16M ; Maximum amount of memory a script may consume (8MB)
I can't even find etc in my
I can't even find etc in my main folder, and in public_html folder.
Out of luck :(
Probably my web hoster hid it.
settings.php
Add this to your settings.php:
ini_set('memory_limit', '100M');
It worked for me on a server that I have no control over. I had to set the limit so high in order to get some image conversions to work...
Would you mind doing me a favour?
Hey.
It seems the above doesn't work.
I don't know what's wrong.
What web hoster are you using?
After all, would you mind trying to do the following:
1) Create an info.php
2) Upload it to anywhere in your website.
Then access it.
3) A page will load up showing you a lot ofinformation about PHP.
Look for the following info:
........................Configuration
..........................PHP Core
Directive.........Local Value......Master Value
.....
memory_limit....?M................?M (<-- Look for these values!)
Tell me what're the value of the above in your case.
Thanks a lot.
Hmm
It worked for me on a server running Linux with Apache 1 and PHP 4. My phpinfo says the memory limit is 8M in both cases which it really isn't, though, because my webapp crashed hard before I set the limit higher.
It seems the phpinfo is not
It seems the phpinfo is not reliable. :P
So I think the settings will work on my server too.
No memory_limit shown in phpinfo()
I am trying to find out what my memory_limit is, but phpinfo() simply doesn't report the value.
I searched for "memory" and then just "mem"
Shared Host
Apache 1.3.37
PHP 4.4.4
Zend Memory Manager enabled
Server API CGI
Can someone explain why the value isn't there?
Same
I've placed php.ini files in numerous locations, and I also tried the ini memory directive in .htaccess.
No memory limit is shown in phpinfo() in the root Drupal directory.
No limit show because there is no limit
My host has php running via CGI rather than as an apache module (I know this isn't a good setting for drupal or any other app that does lots of small bits of php & sql). There is no memory limit set. Well I am sure there is a limit but its handled by the OS and not php.
Both will work (php.ini and settings.php)
you can increase the memory limit in your php.ini file.
memory_limit = 2048M ;
If you have no idea about the location of php.ini file so you can add this line
ini_set('memory_limit', '100M');
in your settings.php file
Great this very usefull
but what is the exact location in the settings.php let me know all file structure?
Best regards,
Omprakash Mankar
Senior Drupal Developer
Any where
you can add this line any where in the file.
Thanks
Best regards,
Omprakash Mankar
Senior Drupal Developer
php.ini
php.ini is the best way.
However, this will work only if your hosting company allows such setting in such file.
--
Drupal development and customization: 2bits.com
Personal: Baheyeldin.com
--
Drupal performance tuning and optimization, hosting, development, and consulting: 2bits.com, Inc. and Twitter at: @2bits
Personal blog: Ba
I am allowed to create
I am allowed to create php.ini
But how can I know if the settings work?
How to check? Use the
How to check? Use the venerable phpinfo function and look for the settings or ask your host provider.
-sp
---------
Test site, always start with a test site.
Drupal Best Practices Guide -|- Black Mountain
-Steven Peck
---------
Test site, always start with a test site.
Drupal Best Practices Guide
It appears none of the methods work?!?
Hi.
Here's what I once tried to add memory_limit code in:
- php.ini
- settings.php
Then I tried to verify the change by uploading 7 running this *.php:
the following info shows:
........................Configuration
..........................PHP Core
Directive.........Local Value......Master Value
memory_limit....8M................8M
Why no change is made?
Does it mean that the memory_limit setting fails?
Is the result reliable to tell no change occurs?
Thanks.
if you have changed a
if you have changed a setting in php.ini you would need to restart the apache service for the change to take effect
this is for godaddy linux
this is for godaddy linux shared hosting users.
settings.php
If Drupal is already installed, you can edit sites/default/settings.php. This method will affect only the site using this file.
Locate the PHP settings section and add the following line at the end of that section:
ini_set('memory_limit', '64M');
It worked for me today.
Thanks
Thanks
Ravi Bhadauria
https://www.admecindia.co.in
https://www.web-development-institute.com
https://www.graphic-design-institute.com
https://www.cadtraininginstitute.com
I increased my memory limit
I increased my memory limit to 364MB, (have confirmed on status report page) but I still can't submit webform forms. the submit button triggers a white error page with this code:
Does anyone know how I can address WEBFORM vs MYSQL DATABASE issues (as that seems to be the issue...)?
Edit PHP.ini file
If you have access to your PHP.ini file, change the line in PHP.ini
If your line shows 64M
webdevelopmentinstitute.com
www.nextgeducation.com