2

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"
},
nikans
  • 2,468
  • 1
  • 28
  • 35
JMcCr
  • 21
  • 1
  • 2
  • I'd say `bundle/Resources/views/Profiler/base_js.html.twig` is not a proper utf-8 encoded file. – zerkms Dec 03 '18 at 22:02
  • I'd assume that too but its straight from symfony repo. Fresh git pull. – JMcCr Dec 03 '18 at 22:06
  • It works on local with the same files and same php settings – JMcCr Dec 03 '18 at 22:06
  • What do you mean by "it works on local"? In how far do your development/production environments differ? – Nicolai Fröhlich Dec 04 '18 at 00:48
  • Nm the local machine, it does differ slightly. On the Vm Ive run symfony 3.4 with php7.1 without issues but the recent move to 4.2 has this broken. I lack the time to work on this so I turned off the web profiler toolbar (site now works .. i'll check into maybe a corrupt file in the profiler later) – JMcCr Dec 04 '18 at 03:44
  • @JMcCr I have the same problem with Symfony 3.4 and PHP 7.3, how did you solve it? – Frank Drebin Nov 19 '19 at 10:55

2 Answers2

0

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.

Frank Drebin
  • 1,063
  • 6
  • 11
0

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