PHP gettext method gives empty response

╄→гoц情女王★ 提交于 2019-12-11 05:44:43

问题


When using the php gettext method like:

error_reporting(E_ALL);
gettext("string");
//OR
_("string");

The server gives an empty response absolutely no output not even an error. When commenting both methods out the page works like expected.

Firefox: The connection was reset

Chrome: No data received

Safari: {shows empty page}

I'm using: latest Zend Server locally on my Mac with OSX Mavericks (10.9.1). Hope someone can help, I'm trying to fix this for about 2 weeks now and nothing seems to work.


回答1:


Seems to be that on some systems setlocale() isn't enough.

http://nl3.php.net/manual/en/function.gettext.php

Setting a language isn't enough for some systems and the putenv() should be used to define the current locale.

The issue was solved when I added:

putenv('LC_ALL=0');


来源:https://stackoverflow.com/questions/21905756/php-gettext-method-gives-empty-response

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!