Reputation: 396
I am using ubuntu 21.04 in that i installed composer by using this command sudo apt-get install composer
,after installing i type composer
it's showing following error
HP Fatal error: Uncaught Error: Call to undefined function Symfony\Component\Console\Helper\mb_detect_encoding() in /usr/share/php/Symfony/Component/Console/Helper/Helper.php:50
Stack trace:
#0 /usr/share/php/Symfony/Component/Console/Descriptor/TextDescriptor.php(329): Symfony\Component\Console\Helper\Helper::strlen('h')
#1 /usr/share/php/Symfony/Component/Console/Descriptor/TextDescriptor.php(97): Symfony\Component\Console\Descriptor\TextDescriptor->calculateTotalWidthForOptions(Array)
#2 /usr/share/php/Symfony/Component/Console/Descriptor/TextDescriptor.php(197): Symfony\Component\Console\Descriptor\TextDescriptor->describeInputDefinition(Object(Symfony\Component\Console\Input\InputDefinition), Array)
#3 /usr/share/php/Symfony/Component/Console/Descriptor/Descriptor.php(55): Symfony\Component\Console\Descriptor\TextDescriptor->describeApplication(Object(Composer\Console\Application), Array)
#4 /usr/share/php/Symfony/Component/Console/Helper/DescriptorHelper.php(67): Symfony\Component\Console\Descriptor\Descriptor->describ in /usr/share/php/Symfony/Component/Console/Helper/Helper.php on line 50
please help me to fix this issue
Upvotes: 12
Views: 29773
Reputation: 91
Hello I encountered this issue on php8.2 while the stack trace differs from OP doing as mentionned by @MiraTech @user16784870 or @Jay-Teli fixed this error :
sudo apt-get install php8.2-mbstring
Upvotes: 5
Reputation: 5465
Check phpinfo.php
for ctype
module information. In my case, it wasn't loaded and I didn't see the following:
I activated it in php.ini
(location depends on your configuration):
;extension=curl
extension=ctype # uncomment or add this
;extension=ffi
and restart php service. You should see ctype
module's block and error should go away.
Upvotes: 0
Reputation:
You simply enable mbstring extension it will remove the uncaught error
sudo apt-get install php7.2-mbstring
Upvotes: 24