title: How to clear php's gettext cache without restart Apache nor change domain?
body: <p>This is a little code snippet from <a href="http://php.net/manual/en/function.gettext.php">php manual</a>:</p>
  
  <pre><code>putenv('LC_ALL=zh_CN');
  setlocale(LC_ALL, 'zh_CN');
  
  bindtextdomain('domain', './locale');
  textdomain('domain');
  
  echo gettext('Hello');
  </code></pre>
  
  <p>Which will output <strong>你好</strong> as defined in <code>domain.mo</code> file, but the problem is as long as the Apache is running, <code>gettext()</code> always return the cached result.</p>
  
  <p>If I change the translation of <strong>Hello</strong> to <strong>您好</strong> in <code>domain.mo</code>, it will still output <strong>你好</strong>.</p>
  
  <p>However there is a fix for this by changing the <code>domain</code> argument of <code>bindtextdomain()</code> and <code>textdomain()</code> to a new name. Like from <code>"domain"</code> to <code>"domain2"</code>. But this is really painful to edit the php file every time I updated the <code>.mo</code> file. </p>
  
  <p>Is there a better way for doing this, like remove some folders or calling some php functions to do the job? So that I can write a little script for this purpose.</p>