I've wrote this test script:
<?php
ini_set('error_reporting', E_ALL );
putenv('LC_ALL=ru_RU.UTF-8');
putenv('LANG=ru_RU');
putenv('LANGUAGE=ru_RU');
setlocale (LC_ALL, "ru_RU.UTF-8");
for($i=0; $i<7; $i++){
echo setlocale(LC_ALL, 0) . "<br>\n";
sleep(1);
}
?>
there is it output:
ru_RU.UTF-8
ru_RU.UTF-8
C
ru_RU.UTF-8
ru_RU.UTF-8
ru_RU.UTF-8
C
Why locale sometimes crashes? How to fix this?