PHP setlocale doesn't work PHP setlocale doesn't work nginx nginx

PHP setlocale doesn't work


I had the same problem after installing additional locales on debian machine running nginx with php5-fpm

To fix the problem I had to restart php5-fpm.


Worked for me after I have ran:

sudo apt-get -y install language-pack-ptservice php7.1-fpm restart<?php date_default_timezone_set('America/Sao_Paulo');setlocale(LC_ALL, 'pt_BR', 'pt_BR.iso88591', 'pt_BR.utf8');echo \Carbon\Carbon::now()->addMonth()->formatLocalized('%d %B %Y');


From the docs (note On Windows):

On Windows, setlocale(LC_ALL, '') sets the locale names from the system's regional/language settings (accessible via Control Panel).

http://php.net/manual/en/function.setlocale.php