Attempted to call function "iconv_strlen"

1

I started using Manjaro and suddenly this error with no other information is appearing. Before in Debian everything was functional. I have not changed anything in a few days. The error is

  

Attempted to call function "iconv_strlen" from namespace "Symfony \ Bridge \ Doctrine \ Logger".

And also has this:

  

Uncaught PHP Exception Symfony \ Component \ Debug \ Exception \ UndefinedFunctionException: "Attempted to call function" iconv_strlen "from namespace" Symfony \ Bridge \ Doctrine \ Logger " at /home/gabriel/NetBeansProjects/Download/symfony/symfony/src/Symfony/Bridge/Doctrine/Logger/DbalLogger.php line 102

Any suggestions of what should be done?

    
asked by anonymous 15.12.2015 / 00:00

2 answers

2

iconv is installed by default (compiled) in the current versions, but it may be that PHP might have been compiled using the flag --without-iconv , if this is the case and you do not have access to the server to reinstall PHP, you can install the "polyfill" to Symfony using composer :

  • Navigate to the project folder:

    cd /home/gabriel/NetBeansProjects/CasaDoGesso
    
  • Type this (you must have composer installed):

    composer require symfony/polyfill-iconv
    
  • Repository: symfony / polyfill

    Other polyfills for symfony

    Install as needed using composer require

    • symfony/polyfill-apcu to use the apcu_
    • symfony/polyfill-php54 to use the functions of PHP 5.4 in previous versions
    • symfony/polyfill-php55 to use PHP 5.5 functions
    • symfony/polyfill-php56 to use PHP functions 5.6 *
    • symfony/polyfill-php70 to use the functions of PHP 7.0 *
    • symfony/polyfill-php71 to use PHP 7.1 functions *
    • symfony/polyfill-iconv to use the iconv
    • symfony/polyfill-intl-grapheme to use the grapheme_*
    • symfony/polyfill-intl-icu to use functions functions and classes intl
    • symfony/polyfill-intl-normalizer to use the intl normalizer
    • symfony/polyfill-mbstring to use the mbstring
    • symfony/polyfill-xml to use the utf8_encode and utf8_decode
    • symfony/polyfill-util utilities for "polyfill"

    If you need (I think it's very unlikely) you can install all at once:

    composer require symfony/polyfill
    
        
    28.04.2017 / 05:19
    1

    The php-iconv library is not installed on the system on which you are running the system. When you call the iconv_strlen method of a given namespace and this method does not exist, PHP thinks you are trying to call a method in the current namespace, which also does not exist.

    To solve, just install the php-iconv library.

    Source: link

        
    17.12.2015 / 12:51