You are here: setlocale() kills site « PHP Programming Language « IT news, forums, messages
setlocale() kills site

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]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация