setlocale() kills site

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Paul Lautman

    setlocale() kills site

    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_TI ME, "C");
    echo '<br>'.strftime ("%A");
    //setlocale(LC_TI ME, "fi_FI");
    echo '<br>'.strftime (" in Finnish is %A,");
    //setlocale(LC_TI ME, "fr_FR");
    echo '<br>'.strftime (" in French %A and");
    //setlocale(LC_TI ME, "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_TI ME, "C");
    echo '<br>'.strftime ("%A");
    //setlocale(LC_TI ME, "fi_FI");
    echo '<br>'.strftime (" in Finnish is %A,");
    //setlocale(LC_TI ME, "fr_FR");
    echo '<br>'.strftime (" in French %A and");
    //setlocale(LC_TI ME, "de_DE");
    echo '<br>'.strftime (" in German %A.\n");
    ?>
    </body>
    </html>


Working...