Greetings

So today I go to log into my site to do some work and respond to posts and what not and I get the dreaded White Screen of Death.

Taking a deep breath, I enable error reporting and quickly learn that cache is causing a memory exhaustion error. So, I clean the cache table via phpmyadmin, try to go back to the site, and get another error:

Fatal error: Allowed memory size of 33554432 bytes exhausted (tried to allocate 77824 bytes) in /home/mythus/mysite.com/profiles/standard/standard.install on line 265

Google has failed me here, so I come to you guys for help. How can I fix this?

Some info: The site was running fine, and recently I had the RAM increased on my VPS from 256 to 512, making the site run even better.

I on occasion let the VPS server be updated. It is an unmanaged centos5 VPS so I do it all myself. I noted that php updated from 5.2.5 to 5.3. When it did though I checked the site quickly and it seemed to still work fine. I then got busy over the next few days and haven't been able to check the site, but I had received a PM from a member on the site, so I assumed the site was still working at that time. So I do not know if the php upgrade caused this issue, however I doubt that it did.

Thanks in advance for any and all help!

Comments

lord_mythus’s picture

Some more info:

I have been working at this with no success. I have tried to run the update.php script where it told me that ubercart was causing issues. So I disabled all of the ubercart modules in phpmyadmin. Then it blamed the problem on something else.

Trying to load the front page always seems to give a different module causing the error. For example, right now it says that database.inc is causing the memory error.

I have increased the php.ini memory limits up to 384M. No success.

Not sure what else to do here... Going to have to wait on smarter people to give me hints/ideas.

Drave Robber’s picture

See Increasing PHP memory limit. It's only using 32M out of your 512, and that's inadequate for anything but a very simple site.

lord_mythus’s picture

But as indicated in my previous post, I did increase my memory limit. I edited php.ini and restarted apache.

I have increased it to 384M for memory limit.

Still the errors persist...

Fatal error: Allowed memory size of 33554432 bytes exhausted (tried to allocate 354164 bytes) in /home/mythus/mysite.com/includes/database/database.inc on line 2139

Drave Robber’s picture

(sorry, I had read only the initial post)

Obviously, memory limit is still 32M. You can verify that in the status report (Reports > Status report).

What is the location of php.ini? (e.g. on an Ubuntu system, it would be /etc/php5/apache2/php.ini)

(I might however be easier not to struggle to debug this and try other methods of increasing PHP memory limit)

lord_mythus’s picture

I just do nano /etc/php.ini

It is a centos 5 VPS. The tricky part is though that I have kloxocp as the webserver control panel, and it overwrites a lot of things for it's own settings.

For example, kloxo overwrites the php.ini file with its own settings. Maybe it is not setting it correctly?

Here's what I mean:

;---
; Added by Kloxo file/phpini/php.ini.temp
;---
register_globals = off
display_errors = off
file_uploads = on
upload_max_filesize = 50M
log_errors = off
output_buffering = off
register_argc_argv = on
magic_quotes_gpc  = off
post_max_size = 55M
magic_quotes_runtime = off
magic_quotes_sybase = off
mysql.allow_persistent = off
max_execution_time = 60
max_input_time = 60
memory_limit = 384M
post_max_size = 55M
allow_url_fopen = on
allow_url_include = on
register_long_arrays = on
session.save_path = /var/lib/php/session
cgi.force_redirect = on
; sendmail_from =
safe_mode = off
enable_dl = on
disable_functions = exec,passthru,shell_exec,system,proc_open,popen,curl_exec,curl_multi_exec,show_source
zlib.output_compression = off

That is in the kloxo settings part of the php.ini file.

Drave Robber’s picture

Go to admin/reports/status/php (that's pointing to phpinfo() page) and look for "Loaded Configuration File" in the very first table. That will tell you the location of .ini file actually used.

lord_mythus’s picture

I can't even get to that page.

Any other way I can find that report?

cfox612’s picture

Upload a new file to the server, call it whatever you want with a php extension, and inside the file write:

<?php
phpinfo();
?>

That page will generate the php info for your server.

Drave Robber’s picture

It's linked from your status report under 'more information' where it shows PHP version, e.g.:

PHP 5.3.10-1ubuntu3.5 (more information)
PHP extensions Enabled
PHP memory limit 128M
lord_mythus’s picture

Loaded Configuration File /etc/php.ini

That is the file it says it loads.

The fun and confusing thing is that it is looking at "local value" and "master value". The "local value has the memory limit at 32M while the "master value" has it at 384M.

So I think that drupal is tripping up over the "local value"... but how in the world to correct that when the php.ini file, that was overwriten, has the "master value"?

I may need to scrounge around for a default php.ini somewhere I guess and see if I can't change it that way...

Drave Robber’s picture

This sounds like another directive is overriding it later.

If "Scan this dir for additional .ini files" has any value, you might want to look in that directory and into any .ini files there.

Also it's possibly overridden in Apache's httpd.conf.

rumblestrip’s picture

The solution for me was to put the following in my .htaccess file

php_value memory_limit 64M

I was on a shared server and my php.ini was not actually the php.ini that controlled php memory. Hope that helps.

lord_mythus’s picture

The only files in the "Scan this dir for additional .ini files" (php.d) are extension files...

curl.ini fileinfo.ini imap.ini mbstring.ini mysql.ini pdo.ini pdo_sqlite.ini wddx.ini xmlreader.ini xsl.ini
dom.ini gd.ini json.ini mcrypt.ini mysqli.ini pdo_mysql.ini phar.ini xcache.noini xmlwriter.ini zip.ini

I looked at them all and saw nothing there that looks weird....

I took a look at httpd.conf and didn't see anything weird... but maybe I am blind to it. Anything that I should look for in apache to see if it is overwriting it?

EDIT:

.... At least that is what I was going to post. But while writing that post a light went off in my head...

I run the site under a client name instead of root.

So, I went into kloxo and into my client id, and checked out the php.ini settings there... and sure enough... there was the culprit.

Changing the values fixed the issue, and the site once again is working!

Thanks for all your help guys!

shams022’s picture

try adding ini_set('memory_limit', '-1'); in settings.php

matts213’s picture

I'm a newbie. I have been getting the WSOD while attempting to move a site from my test server to live. To do this I have copied the files, imported the database, cleared the cache tables, and edited sites/default/settings.php with the new database info. When trying to go to any page I get the fatal error memory message.

adding that bit of code seems to have fixed it. What is that doing exactly and is it a permanent solution that I can leave up for a live site? Do I need to increase the memory settings in php.ini?

-Thanks,
-Matt

feilauren’s picture

This thread is old but for other newbies troubleshooting memory: Don't set it to -1, depending on what you are doing this could overload your computer and freeze it. This is an especially bad idea on the main settings.php file which would affect your production site. Better to give it a specific value, like ini_set('memory_limit', '128M');

You can continue to increase if need be. More info on different ways to increase memory limits in the Drupal docs here: https://www.drupal.org/docs/7/managing-site-performance-and-scalability/...
 

android-developer’s picture

you must increase memory

tcasante1’s picture

This was as a results of newly added class in your php file. Remove the class from the file and it work correctly. Even if you increase the memory size, it will still exhoust it. This normally happens when you have to extends a class to another class in a different file by using the require or include function in your parent class. To extends a class to another, put both class in the same file. This will work without exhausting your memory. hopes it helps

samhaldia’s picture

Need to increase memory_limit conf in php.ini file which resolves the issue ex: 128M or 256M or 384M

Similar issue Ref: https://www.drupal.org/forum/support/post-installation/2013-10-06/fatal-...