简体   繁体   中英

Fatal error: Uncaught Error: Call to undefined function Symfony\Polyfill\Mbstring\iconv() in phar:

I use Ubuntu 16.04 LTS

PHP 7.0.13 NetBean

I try to run some actions linked with composer in the NetBeans environment I had these logs

"/usr/local/ampps/php-7.0/bin/php" "/home/arfa/www/composer.phar" "--ansi" "--no-interaction" "self-update"


Fatal error: Uncaught Error: Call to undefined function Symfony\Polyfill\Mbstring\iconv() in phar:///home/arfa/www/composer.phar/vendor/symfony/polyfill-mbstring/Mbstring.php:520
Stack trace:
#0 phar:///home/arfa/www/composer.phar/vendor/symfony/polyfill-mbstring/bootstrap.php(46): Symfony\Polyfill\Mbstring\Mbstring::mb_strwidth('  [Composer\\Exc...', 'ASCII')
#1 phar:///home/arfa/www/composer.phar/vendor/symfony/console/Application.php(1106): mb_strwidth('  [Composer\\Exc...', 'ASCII')
#2 phar:///home/arfa/www/composer.phar/vendor/symfony/console/Application.php(650): Symfony\Component\Console\Application->stringWidth('  [Composer\\Exc...')
#3 phar:///home/arfa/www/composer.phar/vendor/symfony/console/Application.php(131): Symfony\Component\Console\Application->renderException(Object(Composer\Exception\NoSslException), Object(Symfony\Component\Console\Output\StreamOutput))
#4 phar:///home/arfa/www/composer.phar/src/Composer/Console/Application.php(100): Symfony\Component\Console\Application->run(Object(Symfony\Component\ in phar:///home/arfa/www/composer.phar/vendor/symfony/polyfill-mbstring/Mbstring.php on line 520
Done.

The issue is linked to my project, symfony, settings.

Do you have the iconv extension enabled?

Please post the reply of this command:

php -i | grep -i "iconv support"

Or, search your php.ini file for "extension=iconv.so", if it's commented out, uncomment it and make sure you restart Apache.

If that fails, try installing the composer package:

composer require symfony/polyfill-iconv

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM