|
Posted by Paul Lautman on 05/10/06 12:38
Last night I had a web site. This morning it was returning nothing. I traced
it to a call to setlocale(). It appears that something has happened that
means that any call to setlocale completely kills the site, including
dumping anything that is in the output buffer.
Take a look at http://www.osg-uk.com/st.php and
http://www.osg-uk.com/sts.php the contents of which are shown below.
Anyone got any ideas?
st.php:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>Untitled</title>
</head>
<body>
<?php
echo '1';
//setlocale(LC_TIME, "C");
echo '<br>'.strftime("%A");
//setlocale(LC_TIME, "fi_FI");
echo '<br>'.strftime(" in Finnish is %A,");
//setlocale(LC_TIME, "fr_FR");
echo '<br>'.strftime(" in French %A and");
//setlocale(LC_TIME, "de_DE");
echo '<br>'.strftime(" in German %A.\n");
?>
</body>
</html>
sts.php:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>Untitled</title>
</head>
<body>
<?php
echo '1';
setlocale(LC_TIME, "C");
echo '<br>'.strftime("%A");
//setlocale(LC_TIME, "fi_FI");
echo '<br>'.strftime(" in Finnish is %A,");
//setlocale(LC_TIME, "fr_FR");
echo '<br>'.strftime(" in French %A and");
//setlocale(LC_TIME, "de_DE");
echo '<br>'.strftime(" in German %A.\n");
?>
</body>
</html>
Navigation:
[Reply to this message]
|