php - 'White Screen of Death' Causes - WordPress CMS -
i have installed theme on wordpress , when activated merely results in blank white screen. possible causes of this? , steps in take start finding issue.
the problem revealed when moving site our test server hosting company's sever, have used host various other wordpress sites. causes of white screen in instance? , steps in take start finding issue. have took steps following research such increasing memory limit , disabling plugins etc worked fine on original server doubt can caused plugins etc.
thank you
update
right, far, have increased memory limit 128m, , disabled plugins temporarily naming folders.
i have enabled debugging suggestion @sabari, has resulted in following error: fatal error: call undefined function mb_internal_encoding() in /home/neatly/public_html/wp-content/themes/best_wedding_dress-babe23c7e828662f1a07c296a5608f52/functions.php on line 12
i less useless php make suggestions on how proceed excellent such , how define mb_internal_encoding. here code on line 12:
mb_internal_encoding(get_bloginfo('charset'));
i reiterate worked on our test server , these issues developed when moved new server. have transferred wordpress sites 1 server many times , have re-downloaded , uploaded both content , database 3 times on specific website. both versions (test server , new server) have same versions of wordpress possibly new server has different technology. there along these lines causing error?
answer suggested sabari
the issue solved enabling , configuring mbstring (multibyte support) on our webhost's server.
i think issue regarding mbstring
extension not enabled.
mb_internal_encoding
function requires mbstring
extension . non-default
extension, not enabled default.
you can see more info on how install , configure mb_string
http://www.php.net/mbstring.
if on windows uncomment line (remove semicolon before extension=php_mbstring.dll) extension=php_mbstring.dll;
in php.ini.
if on linux try yum install php-mbstring
centos.
for ubuntu not clear.
restart apache after this.
update :
to check if extension enabeled can use :
if (extension_loaded('mbstring')) { //functions using mb string extensions }
new update :
if (extension_loaded('mbstring')) { mb_internal_encoding(get_bloginfo('charset')); }
i think wordpress has built in function wp_set_internal_encoding()
handle these. need call function in file. wp_set_internal_encoding() same thing explained above :
function wp_set_internal_encoding() { if ( function_exists( 'mb_internal_encoding' ) ) { if ( !@mb_internal_encoding( get_option( 'blog_charset' ) ) ) mb_internal_encoding( 'utf-8' ); } }
it checks whether mb_internal_encoding
function
exists (the function exist if extension loaded). way check if function exists.
the advantage have call function , don't worry other things. wordpress handle .
new update :
for first error, wrap mb_strlen
function inside function_exists ()
:
if ( function_exists( 'mb_strlen' ) ) { mb_strlen(); }
may if have extension enabled , may have been corrupted. better check if function exists before calling .
for second error, don't need add wp_set_internal_encoding
in functions.php or other file. wordpress inbuilt function. need call function wp_set_internal_encoding
. declaring function exists. php return fatal error.
new update
in function have mb_strlen work mbstring extension enabled. should change
function theme_trim_long_str($str, $len = 50, $sep = ' '){ $words = split($sep, $str); $wcount = count($words); while( $wcount > 0 && mb_strlen(join($sep, array_slice($words, 0, $wcount))) > $len) $wcount--; if ($wcount != count($words)) { $str = join($sep, array_slice($words, 0, $wcount)) . '…'; } return $str; }
to
function theme_trim_long_str($str, $len = 50, $sep = ' '){ $words = split($sep, $str); $wcount = count($words); if ( function_exists( 'mb_strlen' ) ) { while( $wcount > 0 && mb_strlen(join($sep, array_slice($words, 0, $wcount))) > $len) $wcount--; } else { while( $wcount > 0 && strlen(join($sep, array_slice($words, 0, $wcount))) > $len) $wcount--; } if ($wcount != count($words)) { $str = join($sep, array_slice($words, 0, $wcount)) . '…'; } return $str; }
hope helps :)
Comments
Post a Comment