PHP setlocale not working even with locales existing PHP setlocale not working even with locales existing php php

PHP setlocale not working even with locales existing


okay, after posting this, I tried one more thing. So for those experiencing the same issue, you need to set this first before setting the new locale:

setlocale(LC_TIME, "");


You have to restart php before use new installed locales.


If you want to use the system default locale in Apache2, you just need to add (or uncomment) the following line in the /etc/apache2/envvars file :

. /etc/default/locale

Think to restart apache2 after this operation and clear your potential cache to check locale is well given to PHP.