m (Reverted edits by AngelinaBelle (talk) to last revision by Kindred) |
No edit summary |
||
Line 1: | Line 1: | ||
{{TOC right}} | |||
==Explanation of the Causes of the White Screen== | ==Explanation of the Causes of the White Screen== | ||
Line 14: | Line 15: | ||
# Ask your host to increase your available memory. | # Ask your host to increase your available memory. | ||
# Switch to a non-overselling host. There are a large number of those hosts listed in our [http://www.simplemachines.org/community/index.php?board=4.0/ Hosts and Hosting] boards | # Switch to a non-overselling host. There are a large number of those hosts listed in our [http://www.simplemachines.org/community/index.php?board=4.0/ Hosts and 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. | ||
# See below for options that you ''can'' try (none are guaranteed to work) if you want to stay on your current host. | # See below for options that you ''can'' try (none are guaranteed to work) if you want to stay on your current host. | ||
===Increase Memory Allocation Externally=== | |||
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 tries to set it high enough using ''ini_set'' when installing a mod package), then it probably will not work, and you are stuck with the server PHP memory limit. | |||
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 | |||
*Creating a [[Phpinfo() - What's that, then|phpinfo.php file]], will tell you your | Using ''phpinfo()'' should also tell you if PHP runs in CGI mode or as an Apache module (''mod_php''). If it runs in CGI mode, htaccess will not work. If PHP runs as an Apache module, use htaccess to set the PHP memory limit: | ||
*Creating a [[Phpinfo() - What's that, then|''phpinfo.php'' file]], will tell you your PHP memory limit. | |||
{{code|1=<nowiki><?php phpinfo(); ?></nowiki>}} | {{code|1=<nowiki><?php phpinfo(); ?></nowiki>}} | ||
*In .htaccess, you can try to add the following: | *In ''.htaccess'', you can try to add the following: | ||
{{code|1=<nowiki>php_value memory_limit 64M</nowiki>}} | {{code|1=<nowiki>php_value memory_limit 64M</nowiki>}} | ||
*If you add this and get a 500 Internal Server Error, then your host is running PHP in CGI Mode, and you will have to increase the memory_limit in the php.ini file. | *If you add this and get a 500 Internal Server Error, then your host is running PHP in CGI Mode, and you will have to increase the memory_limit in the ''php.ini'' file. | ||
{{code|1=<nowiki>memory_limit = 64M</nowiki>}} | {{code|1=<nowiki>memory_limit = 64M</nowiki>}} | ||
If you are not allowed to have a custom php.ini file, you will have to ask your host to do this. | If you are not allowed to have a custom ''php.ini'' file, you will have to ask your host to do this. | ||
===Increase Memory Allocation in the File(s)=== | |||
You can try to increase the memory allocation in the files and functions directly. | |||
You can try to increase the memory allocation in the files and functions | |||
*In /Sources/Class-Package.php, find: | *In ''/Sources/Class-Package.php'', find: | ||
{{code|1=<nowiki> | {{code|1=<nowiki> | ||
// If we're using this try to get some more memory. | // If we're using this try to get some more memory. | ||
Line 47: | Line 49: | ||
</nowiki>}} | </nowiki>}} | ||
*in /Sources/Admin.php, find | *in ''/Sources/Admin.php'', find | ||
{{code|1=<nowiki> | {{code|1=<nowiki> | ||
// Get one of the admin information files from Simple Machines. | // Get one of the admin information files from Simple Machines. |
Revision as of 07:44, 15 April 2015
Explanation of the Causes of the White Screen
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, such as bandwidth, or disk space. The truth is that nobody 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 put far too many "unlimited" accounts on the same physical, or virtual, machine. They then apply "hidden" limits, and shut your forum down, when your usage exceeds these limits. Even though you are, therefore, meant to have been offered an "unlimited" service, you have not.
It is important to realize that there is a limit to how much memory a given script can access, and that 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 a real host will discuss how much you require if you truly need to exceed that amount.
In your case, the host has set this limit low. So low, in fact, that the package manager cannot load Subs-Post.php to process the BBC tags in the readme file of the mod. If that inclusion is bypassed, the script next chokes on the loading of Subs-Package.php, which cannot be bypassed because that file contains the instructions needed to process the Mod package.
How to Solve the Problem
You now have three choices:
- Ask your host to increase your available memory.
- Switch to a non-overselling host. There are a large number of those hosts listed in our Hosts and 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.
- See below for options that you can try (none are guaranteed to work) if you want to stay on your current host.
Increase Memory Allocation Externally
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 tries to set it high enough using ini_set when installing a mod package), then it probably will not work, and you are stuck with the server PHP memory limit.
Using phpinfo() should also tell you if PHP runs in CGI mode or as an Apache module (mod_php). If it runs in CGI mode, htaccess will not work. If PHP runs as an Apache module, use htaccess to set the PHP memory limit:
- Creating a phpinfo.php file, will tell you your PHP memory limit.
<?php phpinfo(); ?>
- 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, then your host is running PHP in CGI Mode, and you will have to increase the memory_limit in the php.ini file.
memory_limit = 64M
If you are not allowed to have a custom php.ini file, you will have to ask your host to do this.
Increase Memory Allocation in the File(s)
You can try to increase the memory allocation in the files and functions directly.
- In /Sources/Class-Package.php, find:
// If we're using this try to get some more memory. @ini_set('memory_limit', '32M');
- Replace with
// If we're using this try to get some more memory. @ini_set('memory_limit', '128M');
- in /Sources/Admin.php, find
// Get one of the admin information files from Simple Machines. function DisplayAdminFile() { global $context, $modSettings, $smcFunc; @ini_set('memory_limit', '32M');
- Replace with
// Get one of the admin information files from Simple Machines. function DisplayAdminFile() { global $context, $modSettings, $smcFunc; @ini_set('memory_limit', '128M');