2
user@user:/opt/lampp/htdocs/gitrepo$ composer update
Loading composer repositories with package information
Updating dependencies (including require-dev)
Your requirements could not be resolved to an installable set of packages.

  Problem 1
    - laravel/framework v5.6.1 requires ext-mbstring * -> the requested PHP extension mbstring is missing from your system.
    - laravel/framework v5.6.0 requires ext-mbstring * -> the requested PHP extension mbstring is missing from your system.
    - laravel/framework 5.6.x-dev requires ext-mbstring * -> the requested PHP extension mbstring is missing from your system.
    - Installation request for laravel/framework 5.6.* -> satisfiable by laravel/framework[5.6.x-dev, v5.6.0, v5.6.1, v5.6.10, v5.6.11, v5.6.12, v5.6.13, v5.6.14, v5.6.15, v5.6.16, v5.6.17, v5.6.18, v5.6.19, v5.6.2, v5.6.20, v5.6.21, v5.6.22, v5.6.23, v5.6.3, v5.6.4, v5.6.5, v5.6.6, v5.6.7, v5.6.8, v5.6.9].

  To enable extensions, verify that they are enabled in those .ini files:
    - /etc/php/7.1/cli/php.ini
    - /etc/php/7.1/cli/conf.d/10-opcache.ini
    - /etc/php/7.1/cli/conf.d/10-pdo.ini
    - /etc/php/7.1/cli/conf.d/15-xml.ini
    - /etc/php/7.1/cli/conf.d/20-calendar.ini
    - /etc/php/7.1/cli/conf.d/20-ctype.ini
    - /etc/php/7.1/cli/conf.d/20-dom.ini
    - /etc/php/7.1/cli/conf.d/20-exif.ini
    - /etc/php/7.1/cli/conf.d/20-fileinfo.ini
    - /etc/php/7.1/cli/conf.d/20-ftp.ini
    - /etc/php/7.1/cli/conf.d/20-gettext.ini
    - /etc/php/7.1/cli/conf.d/20-iconv.ini
    - /etc/php/7.1/cli/conf.d/20-json.ini
    - /etc/php/7.1/cli/conf.d/20-phar.ini
    - /etc/php/7.1/cli/conf.d/20-posix.ini
    - /etc/php/7.1/cli/conf.d/20-readline.ini
    - /etc/php/7.1/cli/conf.d/20-shmop.ini
    - /etc/php/7.1/cli/conf.d/20-simplexml.ini
    - /etc/php/7.1/cli/conf.d/20-sockets.ini
    - /etc/php/7.1/cli/conf.d/20-sysvmsg.ini
    - /etc/php/7.1/cli/conf.d/20-sysvsem.ini
    - /etc/php/7.1/cli/conf.d/20-sysvshm.ini
    - /etc/php/7.1/cli/conf.d/20-tokenizer.ini
    - /etc/php/7.1/cli/conf.d/20-wddx.ini
    - /etc/php/7.1/cli/conf.d/20-xmlreader.ini
    - /etc/php/7.1/cli/conf.d/20-xmlwriter.ini
    - /etc/php/7.1/cli/conf.d/20-xsl.ini
  You can also run `php --ini` inside terminal to see which files are used by PHP in CLI mode

I got this error when i tried to update composer. what solution can resolve it? i have installed php7.1 and i have installed composer too (sudo apt-get install composer)

Ray Coder
  • 620
  • 1
  • 9
  • 23

4 Answers4

2

Your package need some dependancy that it cannot found currently. Try following commands and update composer then,

sudo apt-get install php7.1-mbstring
sudo service apache2 restart
composer update
Shahrukh Anwar
  • 2,004
  • 1
  • 18
  • 20
1

After uncommenting, the said extensions in php.ini file and the composer doesn't function correctly. if you run into the error below, then you need to uncomment some other extensions in php.ini file.

// Error on the terminal when I ran: composer install

Loading composer repositories with package information
Installing dependencies (including require-dev) from lock file
Your requirements could not be resolved to an installable set of packages.

  Problem 1
    - Installation request for league/flysystem 1.0.64 -> satisfiable by league/flysystem[1.0.64].
    - league/flysystem 1.0.64 requires ext-fileinfo * -> the requested PHP extension fileinfo is missing from your system.
  Problem 2
    - league/flysystem 1.0.64 requires ext-fileinfo * -> the requested PHP extension fileinfo is missing from your system.
    - laravel/framework v6.14.0 requires league/flysystem ^1.0.8 -> satisfiable by league/flysystem[1.0.64].
    - Installation request for laravel/framework v6.14.0 -> satisfiable by laravel/framework[v6.14.0].

  To enable extensions, verify that they are enabled in your .ini files:
    - C:\PHP7\php.ini
  You can also run `php --ini` inside terminal to see which files are used by PHP in CLI 
mode.

As this resource and others didn't mention the installation for PHP7.4, but you can still follow them. After I uncommented as mentioned in this article. You'll also need to uncomment

extension=fileinfo
extension=mbstring // probabily this too
akolliy
  • 832
  • 5
  • 13
  • Hi there. Could you clarify what you mean by "This solution might not address the question asked"? If it does not answer the question at all then it should not be posted as an answer. Is it just an answer given for different extensions? If so, that is probably close enough that one does not need to mention the difference. – halfer Feb 17 '20 at 08:14
  • Have addressed it, thank you for bringing it to notice – akolliy Feb 18 '20 at 08:48
0

As the error message "the requested PHP extension mbstring is missing from your system." states your system is missing the PHP extension mbstring.

If you have apt/apt-get installed you can search for the extension using

apt search php7.1-mbstring

To install it use:

sudo apt install php7.1-mbstring
brombeer
  • 6,294
  • 4
  • 18
  • 26
  • i got this php7.1-mbstring is already the newest version (7.1.17-1+ubuntu16.04.1+deb.sury.org+1). – Ray Coder May 28 '18 at 07:55
  • "_To enable extensions, verify that they are enabled in those .ini files:_" Is it enabled? Do you have a file `/etc/php/7.1/cli/conf.d/20-mbstring.ini`? – brombeer May 28 '18 at 07:57
-1
composer install --ignore-platform-reqs \
composer update --ignore-platform-reqs
Shree
  • 18,997
  • 28
  • 86
  • 133
  • 3
    While this code may solve the question, [including an explanation](//meta.stackexchange.com/q/114762) of how and why this solves the problem would really help to improve the quality of your post, and probably result in more up-votes. Remember that you are answering the question for readers in the future, not just the person asking now. Please [edit] your answer to add explanations and give an indication of what limitations and assumptions apply. – Yunnosch Mar 29 '21 at 21:31
  • Also, please explain that this might have severe consequences - what if the application **needs** the given extension to run properly? Do you really want to ignore it? – Nico Haase Mar 31 '21 at 05:15