问题
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