undefined function transliterator_transliterate()

undefined function transliterator_transliterate()

Laurent Berger -
回帖数:11

Hi,

I have update install to moodle 4.0.2+.

my environment is

moodle OK
unicode OK
database mariadb (5.5.5-10.5.16-MariaDB) OK
php OK
pcreunicode OK
php_extension iconv OK
php_extension mbstring OK
php_extension curl OK
php_extension openssl OK
php_extension tokenizer OK
php_extension xmlrpc OK
php_extension soap OK
php_extension ctype OK
php_extension zip OK
php_extension zlib OK
php_extension gd OK
php_extension simplexml OK
php_extension spl OK
php_extension pcre OK
php_extension dom OK
php_extension xml OK
php_extension xmlreader OK
php_extension intl OK
php_extension json OK
php_extension hash OK
php_extension fileinfo OK
php_extension sodium OK
php_extension exif OK
php_setting memory_limit OK
php_setting file_uploads OK
php_setting opcache.enable OK
  and
my php info for intl is

intl

Internationalization supportenabled
ICU version 63.1
ICU Data version 63.1
ICU TZData version 2018e
ICU Unicode version 11.0
DirectiveLocal ValueMaster Value
intl.default_localeno valueno value
intl.error_level00
intl.use_exceptions00

I want to add user using a csv list. I have got an error in scheduler task :

\core\task\send_new_user_passwords_task :

Execute scheduled task: Envoi des nouveaux mots de passe (core\task\send_new_user_passwords_task)
... started 22:02:40. Current memory use 20.4 Mo.
Creating passwords for new users...
... used 7 dbqueries
... used 0.15401792526245 seconds
Scheduled task failed: Envoi des nouveaux mots de passe (core\task\send_new_user_passwords_task),Call to undefined function transliterator_transliterate()

How can i solve this problem?


回复Laurent Berger

Re: undefined function transliterator_transliterate()

Howard Miller -
Core developers的头像 Documentation writers的头像 Particularly helpful Moodlers的头像 Peer reviewers的头像 Plugin developers的头像
Despite all of the above, php_intl is not installed/enabled. Is that phpinfo accessed through Site admin > Server > PHP Info?
回复Howard Miller

Re: undefined function transliterator_transliterate()

Laurent Berger -

thanks for your answer.

About php I get it inside moodle in admin> server >php info






回复Laurent Berger

Re: undefined function transliterator_transliterate()

Laurent Berger -
problem solve. My provider has changed php.ini configuation so something was wrong
Thanks
回复Laurent Berger

Re: undefined function transliterator_transliterate()

Florian LANFRIT -

Hello

Is it possible to know what was modified to the php.ini file because I have exactly the same problem with my hosting provider?

Thanks by advance

Best regards

回复Florian LANFRIT

Re: undefined function transliterator_transliterate()

Laurent Berger -
I'm not sure that I can help you. I think that I changed only

extension=/my_path/sodium-7.3.so
display_errors = off
max_input_vars = 5000
extension=intl.so
include_path="/my_path/pear/"
回复Florian LANFRIT

Re: undefined function transliterator_transliterate()

Howard Miller -
Core developers的头像 Documentation writers的头像 Particularly helpful Moodlers的头像 Peer reviewers的头像 Plugin developers的头像
It's nothing to do with php.ini. The intl code is missing from the PHP build on your hosting.
回复Howard Miller

Re: undefined function transliterator_transliterate()

Florian LANFRIT -
It's weird because the intl plugin is available on the phpinfo page:

intl
Internationalization support enabled
ICU version 63.1
ICU Data version 63.1
ICU TZData version 2018e
ICU Unicode version 11.0
Directive Local Value Master Value
intl.default_locale no value no value
intl.error_level 0 0
intl.use_exceptions 0 0

The second strange thing is that, if I create a php page to test calling this function, it works.
I contacted my hoting provider but I don't know if it will be able to help me if I don't correctly understand the problem.
If you have a idea?

Thanks
回复Florian LANFRIT

Re: undefined function transliterator_transliterate()

Leon Stringer -
Core developers的头像 Particularly helpful Moodlers的头像

Florian: If you see the Call to undefined function transliterator_transliterate() error for the scheduled task then maybe the INTL extension is missing for the command line PHP environment that is used the run the Moodle cron script.

There is a PHP environment used for serving web pages, and normally this would be the same environment used for the cron script. (By "PHP environment" I mean the configuration and build options). But on some servers this may be a different environment or even a different PHP version.

If you have command line shell (SSH) access for your site, try running the command php -i | grep -i intl to see if the INTL extension is present for your command line PHP environment, for example:

$ php -i | grep -i intl 
/etc/php.d/20-intl.ini,
intl
intl.default_locale => no value => no value
intl.error_level => 0 => 0
intl.use_exceptions => 0 => 0