PHP ' mbstring '在Deepin OS-Linux中安装问题



sudo apt-get install php8.2-mbstring

当我运行这个命令来安装php-mbstring时,我得到了这个输出


SYED_AMIR_ALI@amirali:~$ sudo apt-get install php8.2-mbstring
[sudo] password for SYED_AMIR_ALI: 
Verification successful
Reading package lists... Done
Building dependency tree       
Reading state information... Done
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:
The following packages have unmet dependencies:
php8.2-mbstring : Depends: libonig4 (>= 5.9.5) but it is not installable
E: Unable to correct problems, you have held broken packages.

我想安装Laravel Breeze。没有php mbstring,当我尝试使用composer require laravel/breeze --dev这个命令后php artisan breeze:install这个命令安装Laravel breeze,然后我面临这个问题。

SYED_AMIR_ALI@amirali:~/Desktop/laravel-rtk-query$ php artisan breeze:install
Which stack would you like to install?
Error 
Call to undefined function `    TermwindValueObjectsmb_strimwidth()`
at vendor/nunomaduro/termwind/src/ValueObjects/Styles.php:1053

1049▕  */
`    private static function trimText(string $text, int $width): string
{
preg_match_all(self::STYLING_REGEX, $text, $matches, PREG_OFFSET_CAPTURE);
$text = rtrim(mb_strimwidth(preg_replace(self::STYLING_REGEX, '',         $text) ?? '', 0, $width, '', 'UTF-8'));                                                                     

foreach ($matches[0] ?? [] as [$part, $index]) {
$text = substr($text, 0, $index).$part.substr($text, $index, null);
}`

+4 vendor frames 
5 [internal]:0
`TermwindComponentsElement::__toString()`
+23 vendor frames 
29  artisan:35
`IlluminateFoundationConsoleKernel::handle()`

如果你遇到了同样的问题,那么你可以按照下面的步骤操作

在根目录下打开linux debian终端,依次粘贴三个命令-----

——步骤1:wget http://archive.ubuntu.com/ubuntu/pool/universe/libo/libonig/libonig4_6.7.0-1_amd64.deb

,第二步:sudo dpkg -i libonig4_6.7.0-1_amd64.deb

——第三步:sudo apt-get install php7.4-mbstring

最新更新