You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

执行Composer Update时Laravel依赖ext-mbstring缺失报错的解决方案

Fixing the "ext-mbstring is missing" Error During Composer Update

Hey there, let's get this sorted out quickly. The error you're seeing is straightforward—your PHP 7.1 installation doesn't have the mbstring extension installed, which is a required dependency for Laravel 5.6. Since you're using Debian/Ubuntu's apt package manager, here's the step-by-step fix:

  • Install the mbstring extension for PHP 7.1
    First, update your package list and install the extension with this command:

    sudo apt-get update && sudo apt-get install php7.1-mbstring
    

    The update ensures you're pulling the latest package information before installing.

  • Verify the extension is enabled
    After installation, confirm that mbstring is loaded in your CLI PHP environment by running:

    php -m | grep mbstring
    

    If you see mbstring printed in the output, the extension is ready to use.

  • Re-run Composer Update
    Head back to your project directory and execute the update command again:

    composer update
    

    This time, Composer should resolve the dependencies without the missing extension error.

Optional: Restart your web server (if needed)

If you plan to run this Laravel project on a web server like Apache, you'll want to restart the server to ensure the extension is loaded for web requests too:

# For systemd-based systems (Ubuntu 16.04+)
sudo systemctl restart apache2

# For older systems using init.d
sudo service apache2 restart

内容的提问来源于stack exchange,提问作者Ray Coder

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.05.29 07:34:28