-1

I'm trying to create a Laravel project on ubuntu => "XAMPP" installed => "PHP" 8.0.7 => "Composer" 2.0.1.

but I get this error :

Your requirements could not be resolved to an installable set of packages.

Problem 1 - laravel/framework[v8.40.0, ..., 8.x-dev] require ext-mbstring * -> it is missing from your system. Install or enable PHP's mbstring extension. - Root composer.json requires laravel/framework ^8.40 -> satisfiable by laravel/framework[v8.40.0, ..., 8.x-dev].

'''
To enable extensions, verify that they are enabled in your .ini files:
    - /etc/php/8.0/cli/php.ini
    - /etc/php/8.0/cli/conf.d/10-opcache.ini
    - /etc/php/8.0/cli/conf.d/10-pdo.ini
    - /etc/php/8.0/cli/conf.d/20-calendar.ini
    - /etc/php/8.0/cli/conf.d/20-ctype.ini
    - /etc/php/8.0/cli/conf.d/20-curl.ini
    - /etc/php/8.0/cli/conf.d/20-exif.ini
    - /etc/php/8.0/cli/conf.d/20-ffi.ini
    - /etc/php/8.0/cli/conf.d/20-fileinfo.ini
    - /etc/php/8.0/cli/conf.d/20-ftp.ini
    - /etc/php/8.0/cli/conf.d/20-gettext.ini
    - /etc/php/8.0/cli/conf.d/20-iconv.ini
    - /etc/php/8.0/cli/conf.d/20-phar.ini
    - /etc/php/8.0/cli/conf.d/20-posix.ini
    - /etc/php/8.0/cli/conf.d/20-readline.ini
    - /etc/php/8.0/cli/conf.d/20-shmop.ini
    - /etc/php/8.0/cli/conf.d/20-sockets.ini
    - /etc/php/8.0/cli/conf.d/20-sysvmsg.ini
    - /etc/php/8.0/cli/conf.d/20-sysvsem.ini
    - /etc/php/8.0/cli/conf.d/20-sysvshm.ini
    - /etc/php/8.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.
'''
wadaln3ma
  • 22
  • 3
  • Or this? https://stackoverflow.com/questions/62890944/cant-run-composer-update-missing-mbstring – Nico Haase Jun 08 '21 at 07:37
  • Or this? https://stackoverflow.com/questions/49087913/laravel-framework-requires-ext-mbstring – Nico Haase Jun 08 '21 at 07:37
  • Or this? https://stackoverflow.com/questions/44891013/the-requested-php-extension-mbstring-is-missing-from-your-system – Nico Haase Jun 08 '21 at 07:37
  • please do some research before asking a question.. so many questions exist already related to this topic. – zahid hasan emon Jun 08 '21 at 07:40
  • Look Laravel doc : https://laravel.com/docs/8.x/deployment#server-requirements – Boss COTIGA Jun 08 '21 at 08:44
  • The answer which is marked in the question is belong to Windows OS! not Ubuntu OS! nice choice! – Amin Eshtiaghi Jun 08 '21 at 10:10
  • @AminEshtiaghi just choose any of the other answers I've listed – Nico Haase Jun 08 '21 at 10:21
  • @NicoHaase , so based on the second one (which is not approved) and third one which you mentioned my answer is right, I want to know why you devote my answer? (which is right and it's against StackOverflow terms and conditions which I can pursue it). – Amin Eshtiaghi Jun 08 '21 at 11:50
  • What do you mean by "devote my answer"? What do you mean by "against StackOverflow terms and conditions"? – Nico Haase Jun 08 '21 at 12:39
  • I haven't interacted with your answer in any way. Also, it's encouraged to mark a question as a duplicate if it was answered before on SO, instead of posting a new answer that contains merely the same information that is already present in another answer – Nico Haase Jun 08 '21 at 12:50
  • I have tried all these methods and none of them worked , then I found this solution in a Youtube video and it worked, so I shared it. – wadaln3ma Jun 09 '21 at 05:33
  • @NicoHaase and also the answer I posted is not the same as the answers in these post you mentioned, Thank you but you should've checked first. – wadaln3ma Jun 09 '21 at 06:38

2 Answers2

0

I had same issue before and seems yours is very similar which I had. That's why the Ubuntu OS needs required PHP extensions as well. you can install them by following command:

sudo apt update
sudo apt install php php-cli php-fpm php-json php-common php-mysql php-zip php-gd php-mbstring php-curl php-xml php-pear php-bcmath

Also, you can have a look at this article: https://computingforgeeks.com/how-to-install-php-on-ubuntu/

Amin Eshtiaghi
  • 196
  • 3
  • 8
-1

I have found a solution to the problem :

-first after installing XAMPP don't open it. if it's open close it using :

"sudo /opt/lampp/lampp stop"

-then run the following comman :

"sudo gedit /etc/environment"

it will open a text editor modify its content to make like the image below: enter image description here

by adding : ":/opt/lampp/bin/php" to the end

-and then run the following command :

"sudo ln -s /opt/lampp/bin/php /usr/local/bin/php"

-finally start XAMPP using the following command:

"sudo /opt/lampp/lampp start"
wadaln3ma
  • 22
  • 3