By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
457,888 Members | 1,554 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 457,888 IT Pros & Developers. It's quick & easy.

setlocale() kills site

P: n/a
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>
May 10 '06 #1
Share this question for a faster answer!
Share on Google+

This discussion thread is closed

Replies have been disabled for this discussion.