I'm trying to install Craft v3 on a web server currently running Craft 2. As far as I am aware all the required PHP extensions (including iconv) are installed; PHP v7.1.x

The front end works OK, but as soon as I go to the control panel I get this (devmode=true)

> PHP Notice – yii\base\ErrorException iconv(): Wrong charset,
> conversion from `UTF-8' to `UTF-16BE' is not allowed

I should note that my method of installation involves getting the site working on a local machine and then copying everything over, and editing the .ENV and general.php accordingly. There is no added content or plugins installed - just an empty Craft install (latest version).

As far as I can see the database charset is set up correctly (UTF8).

What else should I be looking at?

UPDATE: digging around further, if I run a PHP test file, this line

> $res=iconv('utf-8', 'UTF-16BE', 'test1');

throws the same error message. So I am guessing it is a server problem.

  • Just a guess, but your web server is configured to use UTF-16BE, but the version of iconv you have installed doesn't support it?
    – Brad Bell
    Commented Jun 18, 2019 at 22:31

1 Answer 1


I'm going to attempt to answer my own question now that I have had the issue resolved. Clearly this is a local server environmental issue. The explanation I have received from the hosting provider is not one I understand too well, but here it is for the record.

For security reasons, the PHP FPM process on your server executes scripts in a separate chroot(2) environment, meaning that only a limited set of resources are available at runtime. This sometimes causes problems when the chrooted program requires resources that don't exist outside the chroot environment that are loaded during runtime rather than being built in to the binary, or dynamically linked before the system chroot call. The iconv extension has this problem, in loading .so binary data files corresponding to the encodings it's manipulating. On your server, the files it loads were in /usr/lib/x86_64-linux-gnu/gconv, and had not been copied into the chroot environment at /srv/php-fpm/rdc. Copying the contents of /usr/lib/x86_64-linux-gnu/gconv to /srv/php-fpm/rdc/usr/lib/x86_64-linux-gnu/gconv has fixed the issue.

  • Exactly what I was about to suggest. ;)
    – Brad Bell
    Commented Jun 18, 2019 at 22:42
  • Thanks @brad-bell. I knew you had it in hand! Commented Jun 19, 2019 at 23:16

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.