lshttpd+php pl_PL locale issue

Discussion in 'Install/Configuration' started by pawelz, Oct 5, 2010.

  1. pawelz

    pawelz New Member

    I have two virtual hosts configured in litespead, let's call them example.com and beta.example.com. These vhosts have very similar configuration:

    Code:
    --- Example.xml	2010-10-05 13:56:15.479451164 +0200
    +++ ExampleBETA.xml	2010-10-05 13:55:28.741356271 +0200
    @@ -1,14 +1,14 @@
     <?xml version="1.0" encoding="UTF-8"?>
     <virtualHostConfig>
    -  <docRoot>$VH_ROOT/html</docRoot>
    +  <docRoot>$VH_ROOT/beta</docRoot>
       <adminEmails></adminEmails>
       <enableGzip>0</enableGzip>
       <enableIpGeo>0</enableIpGeo>
       <logging>
         <log>
           <useServer>0</useServer>
    -      <fileName>$VH_ROOT/errorlog/$VH_NAME.error.log</fileName>
    -      <logLevel>INFO</logLevel>
    +      <fileName>/var/log/http/$VH_NAME.error.log</fileName>
    +      <logLevel>ERROR</logLevel>
           <rollingSize>500M</rollingSize>
         </log>
         <accessLog>
    @@ -18,7 +18,7 @@
           <logFormat></logFormat>
           <logHeaders>7</logHeaders>
           <rollingSize>500M</rollingSize>
    -      <keepDays>7</keepDays>
    +      <keepDays>30</keepDays>
           <bytesLog></bytesLog>
           <compressArchive>1</compressArchive>
         </accessLog>
    @@ -33,7 +33,7 @@
         <scriptHandler>
           <suffix>php</suffix>
           <type>lsapi</type>
    -      <handler>Example</handler>
    +      <handler>ExampleBETA</handler>
           <note></note>
         </scriptHandler>
       </scriptHandlerList>
    @@ -41,21 +41,15 @@
         <allowOverride>31</allowOverride>
         <accessFileName>.htaccess</accessFileName>
       </htAccess>
    -  <security>
    -    <accessControl>
    -      <allow></allow>
    -      <deny></deny>
    -    </accessControl>
    -  </security>
       <extProcessorList>
         <extProcessor>
           <type>lsapi</type>
    -      <name>Example</name>
    -      <address>uds://tmp/lshttpd/Example.sock</address>
    +      <name>ExampleBETA</name>
    +      <address>uds://tmp/lshttpd/ExampleBETA.sock</address>
           <note></note>
    -      <maxConns>80</maxConns>
    +      <maxConns>50</maxConns>
           <env>PHP_LSAPI_MAX_REQUESTS=10000</env>
    -      <env>PHP_LSAPI_CHILDREN=80</env>
    +      <env>PHP_LSAPI_CHILDREN=50</env>
           <initTimeout>60</initTimeout>
           <retryTimeout>5</retryTimeout>
           <persistConn>0</persistConn>
    @@ -70,8 +64,8 @@
           <runOnStartUp>1</runOnStartUp>
           <extMaxIdleTime>-1</extMaxIdleTime>
           <priority>0</priority>
    -      <memSoftLimit>0</memSoftLimit>
    -      <memHardLimit>0</memHardLimit>
    +      <memSoftLimit>400M</memSoftLimit>
    +      <memHardLimit>500M</memHardLimit>
           <procSoftLimit>300</procSoftLimit>
           <procHardLimit>300</procHardLimit>
         </extProcessor>
    @@ -79,6 +73,5 @@
       <rewrite>
         <enable>1</enable>
         <logLevel></logLevel>
    -    <rules></rules>
       </rewrite>
     </virtualHostConfig>
    
    The problem is, on beta.example.org locales work, while on example.org don't work. The simplest test case is the following php script:

    Code:
    <?php
    setlocale(LC_ALL, 'pl_PL.utf-8');
    echo strftime("%A %d %B %Y", time());
    ?>
    
    On beta.example.com, as excpected, it prints date in polish locale:
    Code:
    wtorek 05 pa┼║dziernik 2010
    On example.com it prints date in C locale:
    Code:
    Tuesday 05 October 2010
    Could you please give me some hints what I missed, why behavior of almost identical vhosts may differ?

    Thanks in advance.
  2. mistwang

    mistwang LiteSpeed Staff

    check phpinfo page for the locale in effective.
  3. pawelz

    pawelz New Member

    [RESOLVED] lshttpd+php pl_PL locale issue

    It seems to have something to do with memory limits.

    I had increased memory limits to:
    Code:
    Memory Soft Limit (bytes) 400M
    Memory Hard Limit (bytes) 500M
    
    and it resolved my problem.

    I did some tests to confirm that, I'm able to reproduce it: it does not work with memory limits 250M/300M, while it works with 400M/500M.

    The issue is resolved for me, however It seems more workaround than solution. I don't understand why memory limit affects locale behavior. Is it bug?

Share This Page