error in compat.php on line 30
-
When I tried to install a some theme to a host with limited resources, the site did not work. Instead of the normal operation there was a message about a fatal error – out of memory via file wp-includes / compat.php on line 30.
Trying to solve the problem led to the long download error (more 30 second) in same place.Line 30:
preg_match_all (‘/./us’, $ str, $ match);
function belongs _mb_substr, which invoke a function of mb_substr, located in the same file, line 17.
In comments to function _mb_substr written:
// The solution below, works only for utf-8, so in case of a different
// Charset, just use built-in substrFor solve the problems I emulate function _mb_substr for other encodings.
Replacing line 18
return _mb_substr ($ str, $ start, $ length, $ encoding);
on the line
return is_null ($ length)? substr ($ str, $ start): substr ($ str, $ start, $ length);As a result, the site is up and started working.
Actually the question:
This is the core file of WordPress, and it is included in version 4.0. Errors occur for more than 2 years. Maybe we should correct the mistake? or explain what the function does and how to get around this bottleneck in the subject, without making changes to the kernel.
- The topic ‘error in compat.php on line 30’ is closed to new replies.