JMcCr
JMcCr

Reputation: 21

Symfony 4.1 PHP 7.2.10 Notice: iconv(): Wrong charset, conversion from `UTF-8' to `UTF-16BE' is not allowed

Ok, so I have searched other questions without success. I am getting this error on a virtual box, which I cannot alter in any way.

MBString is enabled IconV is enabled

An exception has been thrown during the rendering of a template ("Notice: iconv(): Wrong charset, conversion from UTF-8' toUTF-16BE' is not allowed").

Twig_Error_Runtime
in vendor/symfony/web-profiler- 
bundle/Resources/views/Profiler/base_js.html.twig (line 331)
in vendor/twig/twig/lib/Twig/Template.php->displayWithErrorHandling (line 367)
in vendor/twig/twig/lib/Twig/Template.php->display (line 375)
in vendor/twig/twig/lib/Twig/Extension/Core.php->render (line 1326)
...

'./configure' '--prefix=/****/srv/php/7.2.10' '--with-config-file-path=/****/srv/php/7.2.10/etc' '--with-config-file-scan-dir=/****/srv/php/7.2.10/etc/php.d' '--with-mysql=mysqlnd' '--with-mysqli=mysqlnd' '--with-pdo-mysql=mysqlnd' '--with-fpm-systemd' '--enable-opcache' '--disable-rpath' '--disable-short-tags' '--disable-ipv6' '--disable-debug' '--with-gd' '--with-jpeg-dir' '--with-png-dir' '--with-mcrypt' '--with-mhash' '--with-curl' '--with-xsl' '--enable-intl' '--enable-bcmath' '--with-openssl' '--enable-mbstring' '--enable-mbregex' '--enable-soap' '--with-bz2' '--enable-zip' '--with-zlib' '--enable-static' '--enable-inline-optimization' '--enable-fpm' '--disable-cli' '--disable-phar' 'CFLAGS=-msse2 -mfpmath=sse -O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -fPIC -pie -Wl,-z,relro -Wl,-z,now' 'CXXFLAGS=-msse2 -mfpmath=sse -O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -fPIC -pie -Wl,-z,relro -Wl,-z,now'

Pictures below show the sections from php_info on mbstring and iconv:

PHP ICONV SETTINGS

PHP MBSTRING SETTINGS

Any help would be appreciated.

I also have this in the composer.json, yet does nada

"replace": {
    "symfony/polyfill-ctype": "^1.10",
    "symfony/polyfill-iconv": "^1.10",
    "symfony/polyfill-php71": "^1.10",
    "symfony/polyfill-php70": "^1.10",
    "symfony/polyfill-php56": "^1.10"
},

Upvotes: 2

Views: 3335

Answers (2)

user2772439
user2772439

Reputation: 41

php might be chrooted, but some folders in this chroot are missing.

Upvotes: 0

Frank Drebin
Frank Drebin

Reputation: 1083

I had the exact same problem after updating locally from PHP 7.1 to 7.3 using phpbrew on a Mac. Spent hours debugging... anyways the fix was rather simple: restart your PHP-FPM after switching PHP versions with phpbrew!

So whenever you do:

phpbrew use (some-php-version)

afterwards always restart:

phpbrew fpm restart

The same principle goes for any other OS I guess.

Upvotes: 0

Related Questions