Advertisement:

Author Topic: Do you get the "white screen of death" when accessing Admin or Package Installs?  (Read 207931 times)

Offline Kindred

  • The Mean One
  • Support Specialist
  • SMF Legend
  • *
  • Posts: 58,500
  • Gender: Male
    • Kindred-999 on GitHub
this information has been cleaned and compiled in a wiki article
http://wiki.simplemachines.org/smf/What_the_white_screen_of_death_means_when_accessing_admin_or_package_installs



Thanks to one user, I was able to debug this issue which seems to be affecting a number of you.

The issue appears to be that - when a page is loaded and the script tries to load one (or more) additional files to perform sub-tasks, the system runs out of allocated memory.

The reason this is happening is because those of you encountering this issue are very likely running your site on an overselling host.
This means that the host you chose sells sites with "unlimited" stuff (bandwidth, disk space, etc.)  The truth is: No one could actually afford to sell "unlimited" everything (or anything). Hosts need to pay for expenses and make money... The host that you chose may ADVERTISE "unlimited", but in reality, they have severely limited your account, because they stuff far too many "unlimited" accounts on the same physical or virtual machine. They then apply "hidden" limits and shut you down when your usage exceeds these limits (even though you're supposed to be unlimited, you're not).

In this case, there is a limit to how much memory a given script can access. Now, don't get me wrong... every host has a limit like this. A REAL host, however, has a reasonable amount and will not put far too many accounts on a single server such that they overuse the available resources and they will discuss how much you need if you truly need to exceed that amount.

In your case, the host has set this limit low. So low that the package manager can not load Subs-Post.php to process the BBC tags in the readme file of the mod. If we bypass that inclusion, the script next chokes on the loading of Subs-Package.php which can not be bypassed because that file contains the instructions needed to process the Mod package.

You now have two choices.
1- ask your host to increase your available memory.
2- switch to a non-overselling host. There are a large number of those hosts listed in our Hosts & Hosting boards
These hosts may be slightly more expensive than the one that you originally chose, but, as is often the case, you do get what you pay for.
« Last Edit: July 11, 2013, 02:09:34 PM by Kindred »
Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

Offline Kindred

  • The Mean One
  • Support Specialist
  • SMF Legend
  • *
  • Posts: 58,500
  • Gender: Male
    • Kindred-999 on GitHub
You can try and use a .htaccess file to overwrite the memory limit, but if the server controls it (which is probably the case, since SMF, I believe tries to set it high enough using ini_set when installing a mod package), than it probably won't work, and you are stuck with the server php memory limit.  Creating a phpinfo.php file, will tell you your php memory limit.
Code: [Select]
<?php echo phpinfo(); ?>
Alternatively, you could try and up the ini_set value on the php memory_limit when installing packages in SMF (not sure what the current setting is for this), but that might also work, using the ini_set

Code: [Select]
ini_set('memory_limit','64M');
Of course, this only works for the current operation, so just use it in the actual function that is causing the problem perhaps.

phpinfo() should also tell you if PHP runs in CGI mode or as an Apache module (mod_php).  If CGI mode htaccess won't work, if Apache module, use htaccess to set the php memory limit:

In .htaccess, you can try to add the following:
Code: [Select]
php_value memory_limit 64M
If you add this and get a 500 Internal Server Error, than you are running PHP in CGI Mode, and should ask the server to up the memory_limit in the php.ini file, or perhaps you can do this yourself.  But if you can't, ask the server to do this.


from further down in this thread, one user claims to have fixed this on his system. We make no claims as to the validity of this fix (reportedly, it works for some)
Quote

Code: (in /Sources/Class-Package.php) [Select]
// If we're using this try to get some more memory.
@ini_set('memory_limit', '32M');
Changing it to 128M fixed the issue with the package manager

Code: (in /Source/Admin.php) [Select]
// Get one of the admin information files from Simple Machines.
function DisplayAdminFile()
{
global $context, $modSettings, $smcFunc;

@ini_set('memory_limit', '32M');
After changing the value to 128M, the issue was resolved for the admin screens.
« Last Edit: June 14, 2013, 10:09:42 AM by Kindred »
Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

ValleyJim

  • Guest
I have seen this several times.  I can access everything until I upload a zip file to install.  When I do this and click install I get a blank screen.  Then when I try to access browse I get a blank screen.

Everything worked fine before but I had to reinstall the board and am now having this problem. Same host same everything. 

Everyone says increase memory but according to phpinfo I am set at 64M so what should it be set to?

Thanks
Jim

Offline Kindred

  • The Mean One
  • Support Specialist
  • SMF Legend
  • *
  • Posts: 58,500
  • Gender: Male
    • Kindred-999 on GitHub
Wow.w someone who reads the stickies!

;)

Congrats. You are the first to figure it out without a pointed link. :)
 On to the issue...
Let me guess... Your host is hosting24 or 000webhost....

In which case, they declare that you have a certain amount of memory, but, as far as I can tell, you do not actually have that much. Y only suggestion, if I am correct in my assumption of your host is - get a better host.
Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

ValleyJim

  • Guest
Actually no, I have a paid host.  And as I said according to phpinfo I am set at 64M for memory.

So if that is not enough then what should I ask for when I contact them?

Offline Kindred

  • The Mean One
  • Support Specialist
  • SMF Legend
  • *
  • Posts: 58,500
  • Gender: Male
    • Kindred-999 on GitHub
"paid" host is not specifically relevant.

Who is your host?

64 SHOULD be ok, *IF* you actually have 64...
That's what I was trying to say...   we already know that 2 specific hosts REPORT a certain memory available but in reality, it chokes at 32.
Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

Offline j0hny21

  • Semi-Newbie
  • *
  • Posts: 62
I hav host 000webhost.com and is the same, the first attempt to load and white screen and nothing more could be done.
any ideas what to do? Because this what is up, anything I do not understand.

Offline NanoSector

  • SMF Friend
  • SMF Super Hero
  • *
  • Posts: 10,500
  • Gender: Male
  • VC321xb47@aperture:~#
    • Yoshi2889 on GitHub
I hav host 000webhost.com and is the same, the first attempt to load and white screen and nothing more could be done.
any ideas what to do? Because this what is up, anything I do not understand.
Please read the first post.
My Mods / Mod Builder - A tool to easily create mods / Blog
"I've heard from a reliable source that the Answer is 42. But, still no word on what the question is."

Offline Colin

  • SMF Friend
  • SMF Hero
  • *
  • Posts: 7,876
  • Gender: Male
  • SMF Developer
    • colinschoen on GitHub
"If everybody is thinking alike, then somebody is not thinking." - Gen. George S. Patton Jr.

Colin

Offline Tavsih

  • Jr. Member
  • **
  • Posts: 133
I got this problem at first ,the '000Webhost' staff told me that its because of free account ,They have set a limit for php/html files for each free user.
Original topic
http://www.simplemachines.org/community/index.php?topic=494751.msg3468868#msg3468868

Offline Arantor

  • Resident Overthinker
  • SMF Friend
  • SMF Legend
  • *
  • Posts: 71,621
    • StoryBB/StoryBB on GitHub
Except that doesn't entirely agree with the error PHP is reporting. The number of PHP files doesn't trigger the 'memory limit' in PHP, unless they have a nastily modified version.

Thing is, the rest of the advice stands: if you use a free host (for whom you are COSTING them money), expect trouble.
Don’t try to tell me that some power can corrupt a person. You haven’t had enough to know what it’s like.

No good deed goes unpunished / No act of charity goes unresented.

Offline RustyBarnacle

  • Sr. Member
  • ****
  • Posts: 722
    • Saving Tallingroth
I was getting this a lot way back in the way back.  Since then I copy my php.ini file from forum to forum and my host seems to be OK with me overriding the memory limits with it.

This is all that's my copy of that file and while I'm not sure I'd ever be able to upload a file of this size but I threw it in there in case I ever tried.  :)

Code: [Select]
session.save_path = /tmp

memory_limit = 48M

max_execution_time = 300

upload_max_filesize = 10G

SetEnv TZ America/Vancouver

Offline Kindred

  • The Mean One
  • Support Specialist
  • SMF Legend
  • *
  • Posts: 58,500
  • Gender: Male
    • Kindred-999 on GitHub
yes, as indicated above, that will work, if your host honors a local php.ini.

Many of the discount or free hosts do not.
Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

Offline perpetummdl

  • Newbie
  • *
  • Posts: 2
Wow.w someone who reads the stickies!

;)

Congrats. You are the first to figure it out without a pointed link. :)
 On to the issue...
Let me guess... Your host is hosting24 or 000webhost....

In which case, they declare that you have a certain amount of memory, but, as far as I can tell, you do not actually have that much. Y only suggestion, if I am correct in my assumption of your host is - get a better host.

Let's get things straight here. I've run into an issue of not being able to install a specific package (on hosting24.com) via Package Manager and receiving the php error claiming that the limit of 32M is exceeded. Well, guess what, after some investigating (.htaccess and ini_set did not help) I came across these lines in the /Sources/Class-Package.php file:

Code: [Select]
// If we're using this try to get some more memory.
@ini_set('memory_limit', '32M');

Changing it to 128M fixed the issue. So, please, kindly do stop blaming the webhost for your own shortcomings and lack of knowledge of your own scripting. This is appalling. Make a master setting in the admin area or Settings.php to supersede all others, instead of re-defining the php memory limit inside your scripts. Hosting24 and 000webhost is not "choking" at 32 MB, get your facts straight. You can always use a test script to make sure that the webhost is providing the memory limit they declare with phpinfo():


Code: [Select]
<?php
// This is only an example, the numbers below will
// differ depending on your system

for ($i=1$i<100$i++) {
//echo "used memory is " . memory_get_usage() . "<br/>";
$a loadmem($i); 
//echo "used memory after allocating ".$i."m is " . memory_get_usage() . "<br/>"; // 57960
//echo "used memory after unsetting allocated memory is " . memory_get_usage() . "<br/>"; // 36744
echo "You have allocated "$i "M ("memory_get_usage() . ") memory in this php script" "<br />";
unset($a);
}

function 
loadmem($howmuchmeg) {
$a str_repeat("0"$howmuchmeg 1024 1024); // alocating 10 chars times million chars
return $a;
}

?>


If you're a hosting24 or 000webhost user, you'd see that this script returns a php "Allowed memory size of" error after the last iteration (which would be ~124MB and ~60MB respectively), which means that the limits are exactly what the hosting claims them to be. It would be kind of you to stop spreading disinformation. Thank you, I hope you escalate my findings, so that other users can swiftly resolve any php memory issues with SMF.

TheListener

  • Guest
Considering some of the team members are Hosting Company owners I do believe they know what they are talking about.

Most of their knowledge is experience talking.


As for Arantor well for someone whom knows smf practically inside and out to be told he doesn't know what he is talking about................

Offline Kindred

  • The Mean One
  • Support Specialist
  • SMF Legend
  • *
  • Posts: 58,500
  • Gender: Male
    • Kindred-999 on GitHub
I will also note that this same line is used in EVERY install of SMF - but only appears to be a problem on 000webhost and hosting24.
Additionally, we experimented with adding memory to various spots within several files with no beneficial results.

It's good that you found something which appears to work for you. Perhaps it will work for others as well.
However, considering the frequency of the report and the fact that the report seems to only happen on those two webhosts, I will hold off changing my opinion or post until there is sufficient proof otherwise.
Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

Offline perpetummdl

  • Newbie
  • *
  • Posts: 2
I will also note that this same line is used in EVERY install of SMF - but only appears to be a problem on 000webhost and hosting24.
Additionally, we experimented with adding memory to various spots within several files with no beneficial results.

It's good that you found something which appears to work for you. Perhaps it will work for others as well.
However, considering the frequency of the report and the fact that the report seems to only happen on those two webhosts, I will hold off changing my opinion or post until there is sufficient proof otherwise.

Okay, how's that. I've ran into the memory issue once again and found these lines inside /Source/Admin.php:

Code: [Select]
// Get one of the admin information files from Simple Machines.
function DisplayAdminFile()
{
global $context, $modSettings, $smcFunc;

@ini_set('memory_limit', '32M');

After changing the value to 128 MB, the issue was resolved. How on earth would this issue be caused by the webhost? It's quite weird that the limit would be re-defined on almost every single php file, why is that necessary?
I cannot fully post proof without revealing hosting account details, however, you may test this easily by tinkering with those lines inside the scripts.
Whatever the reason is, be it the user setting these limits, default values or some other script re-defining the php memory value, THIS IS NOT CAUSED BY THE WEBHOSTING PROVIDER.

Offline RavenCocaine

  • Newbie
  • *
  • Posts: 2
Well for some reason i know what happening now , but i don't know yet what to do. How is that possible with host? If we create SMF forum wich supported by This Forum , so why those kind of ******s should affect us ?

kat

  • Guest
Coz some hosts are crap.

You do know what to do, coz Kindred told you, in his first post.

Quote
You now have two choices.
1- ask your host to increase your available memory.
2- switch to a non-overselling host. There are a large number of those hosts listed in our Hosts & Hosting boards

Offline Kindred

  • The Mean One
  • Support Specialist
  • SMF Legend
  • *
  • Posts: 58,500
  • Gender: Male
    • Kindred-999 on GitHub
well, you can also try the two updates suggested by perpetummdl
Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.