<p>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.</p>

<blockquote>
  <p>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.</p>
</blockquote>

CC BY-SA 4.0
2019-06-18T22:42:39.273Z
Exactly what I was about to suggest. ;)
Brad Bell
CC BY-SA 4.0
2019-06-19T23:16:45.170Z
Thanks @brad-bell. I knew you had it in hand!
Jack McKenzie
CC BY-SA 4.0
2019-06-18T22:40:36.250Z
2019-06-18T22:40:36.250Z
Jack McKenzie
<p>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</p>

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

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

<p>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).</p>

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

<p>What else should I be looking at?</p>

<p>UPDATE: digging around further, if I run a PHP test file,  this line</p>

<pre><code>&gt; $res=iconv('utf-8', 'UTF-16BE', 'test1');
</code></pre>

<p>throws the same error message. So I am guessing it is a server problem.</p>

CC BY-SA 4.0
2019-06-18T22:31:03.617Z
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
<craft3><install>
Charset issue in Control Panel
# Charset issue in Control Panel

(Asked by: username_0 on 2019-06-18)

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.

**Tags:** craft3, install
> **Comments:**
> **username_1**: 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?  

---

## 1 answers

### Answer by username_0 on 2019-06-18. Score: 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.

> **Comments:**
> **username_1**: Exactly what I was about to suggest. ;)  
> **username_0**: Thanks @brad-bell. I knew you had it in hand!  

---

