英文:
Ubuntu 18.04: laravel/framework v6.9.0 requires ext-mbstring * -> the requested PHP extension mbstring is missing from your system
问题
以下是您要翻译的内容:
在有人因重复问题而将此问题关闭之前,我已经检查了其他页面,但它们没有帮助。
我正在尝试在PHP 7.2上安装Laravel 6的包,我也尝试了PHP 7.4。
不幸的是,我收到以下错误消息:
laravel/framework v6.9.0需要ext-mbstring * -> 请求的PHP扩展mbstring在您的系统中不存在。
我已安装了mbstring并在7.2和7.4的php.ini文件中取消了注释:
extension=mbstring
我唯一知道的解决方法是重新启动apache2服务器。但我仍然收到错误消息。
我的composer.json需要PHP 7.2。
我还遇到了以下错误消息:
要启用扩展,请验证它们在您的.ini文件中是否已启用:
- /etc/php/7.4/cli/php.ini
- /etc/php/7.4/cli/conf.d/10-mysqlnd.ini
- /etc/php/7.4/cli/conf.d/10-opcache.ini
- /etc/php/7.4/cli/conf.d/10-pdo.ini
- /etc/php/7.4/cli/conf.d/15-xml.ini
- /etc/php/7.4/cli/conf.d/20-calendar.ini
- /etc/php/7.4/cli/conf.d/20-ctype.ini
- /etc/php/7.4/cli/conf.d/20-dom.ini
- /etc/php/7.4/cli/conf.d/20-exif.ini
- /etc/php/7.4/cli/conf.d/20-ffi.ini
- /etc/php/7.4/cli/conf.d/20-fileinfo.ini
- /etc/php/7.4/cli/conf.d/20-ftp.ini
- /etc/php/7.4/cli/conf.d/20-gd.ini
- /etc/php/7.4/cli/conf.d/20-gettext.ini
- /etc/php/7.4/cli/conf.d/20-iconv.ini
- /etc/php/7.4/cli/conf.d/20-json.ini
- /etc/php/7.4/cli/conf.d/20-mysqli.ini
- /etc/php/7.4/cli/conf.d/20-pdo_mysql.ini
- /etc/php/7.4/cli/conf.d/20-phar.ini
- /etc/php/7.4/cli/conf.d/20-posix.ini
- /etc/php/7.4/cli/conf.d/20-readline.ini
- /etc/php/7.4/cli/conf.d/20-shmop.ini
- /etc/php/7.4/cli/conf.d/20-simplexml.ini
- /etc/php/7.4/cli/conf.d/20-sockets.ini
- /etc/php/7.4/cli/conf.d/20-sysvmsg.ini
- /etc/php/7.4/cli/conf.d/20-sysvsem.ini
- /etc/php/7.4/cli/conf.d/20-sysvshm.ini
- /etc/php/7.4/cli/conf.d/20-tokenizer.ini
- /etc/php/7.4/cli/conf.d/20-xmlreader.ini
- /etc/php/7.4/cli/conf.d/20-xmlwriter.ini
- /etc/php/7.4/cli/conf.d/20-xsl.ini
您还可以在终端中运行`php --ini`以查看PHP在CLI模式下使用的文件。```
<details>
<summary>英文:</summary>
Before someone takes this down for duplication. I've checked the other pages and they weren't helpful.
I'm trying to install a package for Laravel 6 on PHP 7.2. I've also tried PHP 7.4.
Unfortunately, I get the following error:
laravel/framework v6.9.0 requires ext-mbstring * -> the requested PHP extension mbstring is missing from your system.
I've installed mbstring and uncommented it in both the php.ini files for 7.2 and 7.4:
extension=mbstring
The only solution to this I would know is restarting the apache2 server. But I still get the error.
My composer.json is requiring PHP 7.2.
I'm also presented with these errors:
-
Installation request for laravel/framework (locked at v6.9.0, required as ^6.2) -> satisfiable by laravel/framework[v6.9.0].
To enable extensions, verify that they are enabled in your .ini files:
- /etc/php/7.4/cli/php.ini
- /etc/php/7.4/cli/conf.d/10-mysqlnd.ini
- /etc/php/7.4/cli/conf.d/10-opcache.ini
- /etc/php/7.4/cli/conf.d/10-pdo.ini
- /etc/php/7.4/cli/conf.d/15-xml.ini
- /etc/php/7.4/cli/conf.d/20-calendar.ini
- /etc/php/7.4/cli/conf.d/20-ctype.ini
- /etc/php/7.4/cli/conf.d/20-dom.ini
- /etc/php/7.4/cli/conf.d/20-exif.ini
- /etc/php/7.4/cli/conf.d/20-ffi.ini
- /etc/php/7.4/cli/conf.d/20-fileinfo.ini
- /etc/php/7.4/cli/conf.d/20-ftp.ini
- /etc/php/7.4/cli/conf.d/20-gd.ini
- /etc/php/7.4/cli/conf.d/20-gettext.ini
- /etc/php/7.4/cli/conf.d/20-iconv.ini
- /etc/php/7.4/cli/conf.d/20-json.ini
- /etc/php/7.4/cli/conf.d/20-mysqli.ini
- /etc/php/7.4/cli/conf.d/20-pdo_mysql.ini
- /etc/php/7.4/cli/conf.d/20-phar.ini
- /etc/php/7.4/cli/conf.d/20-posix.ini
- /etc/php/7.4/cli/conf.d/20-readline.ini
- /etc/php/7.4/cli/conf.d/20-shmop.ini
- /etc/php/7.4/cli/conf.d/20-simplexml.ini
- /etc/php/7.4/cli/conf.d/20-sockets.ini
- /etc/php/7.4/cli/conf.d/20-sysvmsg.ini
- /etc/php/7.4/cli/conf.d/20-sysvsem.ini
- /etc/php/7.4/cli/conf.d/20-sysvshm.ini
- /etc/php/7.4/cli/conf.d/20-tokenizer.ini
- /etc/php/7.4/cli/conf.d/20-xmlreader.ini
- /etc/php/7.4/cli/conf.d/20-xmlwriter.ini
- /etc/php/7.4/cli/conf.d/20-xsl.ini
You can also runphp --ini
inside terminal to see which files are used by PHP in CLI mode.
</details>
# 答案1
**得分**: 4
尝试安装 mbstring 扩展。
sudo apt-get install php7.4-mbstring
<details>
<summary>英文:</summary>
Try to install mbstring extension.
sudo apt-get install php7.4-mbstring
</details>
# 答案2
**得分**: 4
请在Ubuntu操作系统上运行以下命令。
1. Sudo apt-get update
2. sudo apt-get install php-mbstring
<details>
<summary>英文:</summary>
Please run the below commands on Ubuntu OS.
1. Sudo apt-get update
2. sudo apt-get install php-mbstring
</details>
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论