Do you get the "white screen of death" when accessing Admin or Package Installs?

Started by Kindred, April 22, 2013, 10:23:45 PM

Previous topic - Next topic

Kindred

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.
Слaва
Украинi

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

"Loki is not evil, although he is certainly not a force for good. Loki is... complicated."

Kindred

Quote from: SoLoGHoST on April 23, 2013, 01:19:02 AM
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.
<?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

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:
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.
Слaва
Украинi

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

"Loki is not evil, although he is certainly not a force for good. Loki is... complicated."

ValleyJim

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

Kindred

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.
Слaва
Украинi

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

"Loki is not evil, although he is certainly not a force for good. Loki is... complicated."

ValleyJim

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?

Kindred

"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.
Слaва
Украинi

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

"Loki is not evil, although he is certainly not a force for good. Loki is... complicated."

j0hny21

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.

NanoSector

Quote from: j0hny21 on May 05, 2013, 03:32:22 AM
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."

Colin

"If everybody is thinking alike, then somebody is not thinking." - Gen. George S. Patton Jr.

Colin

Tavsih

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

Arantor

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.

RustyBarnacle

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.  :)


session.save_path = /tmp

memory_limit = 48M

max_execution_time = 300

upload_max_filesize = 10G

SetEnv TZ America/Vancouver

Kindred

yes, as indicated above, that will work, if your host honors a local php.ini.

Many of the discount or free hosts do not.
Слaва
Украинi

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

"Loki is not evil, although he is certainly not a force for good. Loki is... complicated."

perpetummdl

Quote from: Kindred on May 03, 2013, 10:51:53 PM
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 hxxp:hosting24.com [nonactive]) 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:

// 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():


<?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

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................

Kindred

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.
Слaва
Украинi

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

"Loki is not evil, although he is certainly not a force for good. Loki is... complicated."

perpetummdl

Quote from: Kindred on June 10, 2013, 09:45:59 PM
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:

// 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.

RavenCocaine

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

Coz some hosts are crap.

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

QuoteYou 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

Kindred

Слaва
Украинi

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

"Loki is not evil, although he is certainly not a force for good. Loki is... complicated."

Advertisement: