安装composer在laravel 5.5中需要barryvdh / laravel-dompdf时遇到错误。为什么?
安装作曲家后我收到此错误
Your requirements could not be resolved to an installable set of packages.
Problem 1
- laravel/framework v5.5.28 requires ext-mbstring * -> the requested PHP extension mbstring is missing from your system.
- laravel/framework v5.5.28 requires ext-mbstring * -> the requested PHP extension mbstring is missing from your system.
- laravel/framework v5.5.28 requires ext-mbstring * -> the requested PHP extension mbstring is missing from your system.
- Installation request for laravel/framework == 5.5.28.0 -> satisfiable by laravel/framework[v5.5.28].
To enable extensions, verify that they are enabled in those .ini files:
- /etc/php/7.0/cli/php.ini
- /etc/php/7.0/cli/conf.d/10-opcache.ini
- /etc/php/7.0/cli/conf.d/10-pdo.ini
- /etc/php/7.0/cli/conf.d/20-calendar.ini
- /etc/php/7.0/cli/conf.d/20-ctype.ini
- /etc/php/7.0/cli/conf.d/20-curl.ini
- /etc/php/7.0/cli/conf.d/20-exif.ini
- /etc/php/7.0/cli/conf.d/20-fileinfo.ini
- /etc/php/7.0/cli/conf.d/20-ftp.ini
- /etc/php/7.0/cli/conf.d/20-gettext.ini
- /etc/php/7.0/cli/conf.d/20-iconv.ini
- /etc/php/7.0/cli/conf.d/20-json.ini
- /etc/php/7.0/cli/conf.d/20-phar.ini
- /etc/php/7.0/cli/conf.d/20-posix.ini
- /etc/php/7.0/cli/conf.d/20-readline.ini
- /etc/php/7.0/cli/conf.d/20-shmop.ini
- /etc/php/7.0/cli/conf.d/20-sockets.ini
- /etc/php/7.0/cli/conf.d/20-sysvmsg.ini
- /etc/php/7.0/cli/conf.d/20-sysvsem.ini
- /etc/php/7.0/cli/conf.d/20-sysvshm.ini
- /etc/php/7.0/cli/conf.d/20-tokenizer.ini
You can also run `php --ini` inside terminal to see which files are used by PHP in CLI mode.
Installation failed, reverting ./composer.json to its original content.
请帮助我,我不知道为什么会出现这样的错误
答案 0 :(得分:0)
安装mb-string
包
sudo apt-get install php-mbstring
或者你可以使用PHP 7,
sudo apt-get install php-gd php-xml php7.0-mbstring
答案 1 :(得分:0)
我安装了所有哦,现在得到错误
Your requirements could not be resolved to an installable set of packages.
Problem 1
- symfony/event-dispatcher v4.0.2 requires php ^7.1.3 -> your PHP version (7.0.22) does not satisfy that requirement.
- symfony/event-dispatcher v4.0.2 requires php ^7.1.3 -> your PHP version (7.0.22) does not satisfy that requirement.
- symfony/event-dispatcher v4.0.2 requires php ^7.1.3 -> your PHP version (7.0.22) does not satisfy that requirement.
- Installation request for symfony/event-dispatcher == 4.0.2.0 -> satisfiable by symfony/event-dispatcher[v4.0.2].
Installation failed, reverting ./composer.json to its original content.
答案 2 :(得分:0)
你的composer.json对php的要求是错误的。
应该是例如"php": ">=7.0.0",