HackerOne users: Testing against this community violates our program's Terms of Service and will result in your bounty being denied.
setlocale and php 5.6
jackmaessen
✭✭✭
I am trying to run this script on the server in which php 5.6 is enabled and it gives me a die...
/* Set locale to Dutch */ date_default_timezone_set("Europe/Amsterdam"); setlocale(LC_ALL, 'nl_NL') or die('no dutch');
this also dies:setlocale(LC_ALL, 'nl_NL.utf8') or die('no dutch');
and this also:setlocale(LC_ALL, 'nl_NL@euro') or die('no dutch');
Even other languages; they all die
setlocale(LC_ALL, 'de_DE') or die('no german'); setlocale(LC_ALL, 'de_DE.utf8') or die('no german utf8'); setlocale(LC_ALL, 'de_DE@euro') or die('no german @euro'); setlocale(LC_ALL, 'fr_FR') or die('no french'); setlocale(LC_ALL, 'fr_FR.utf8') or die('no french utf8'); setlocale(LC_ALL, 'fr_FR@euro') or die('no french @euro');
This problem is only at version 5.6 .
Version 5.5 works everything fine
Is this problem due to 5.6 version or are the locales not installed on the server?
Tagged:
0
Comments
According to the documentation, http://php.net/manual/en/function.setlocale.php. The acceptable strings for locales are dependent upon the system.
You can get the current setting by calling setlocale with 0 as the second parameter.
phpinfo should give you information about your server configuration as well.
Search first
Check out the Documentation! We are always looking for new content and pull requests.
Click on insightful, awesome, and funny reactions to thank community volunteers for their valuable posts.