Friday, May 17, 2024
 Popular · Latest · Hot · Upcoming
6
rated 0 times [  6] [ 0]  / answers: 1 / hits: 19733  / 1 Year ago, sat, march 11, 2023, 12:36:42

I am trying to install Laravel. I am on Ubuntu 18.04.5 LTS, have php 8.0.2, and running Apache2. My issue is that I can't install Laravel as it keeps giving the error that I don't have the 'mbstring' extension.


When I do the commands


sudo apt update

sudo apt install php-mbstring

they get installed to /etc/php/7.2/mods-available. Laravel is looking for the extensions in /etc/php/8.0/. I have also tried installing the newest version of mbstring:


sudo apt install php8.0-mbstring

But get the error


Reading package lists... Done
Building dependency tree
Reading state information... Done
E: Unable to locate package php8.0-mbstring
E: Couldn't find any package by glob 'php8.0-mbstring'
E: Couldn't find any package by regex 'php8.0-mbstring'


Can someone help me figure this out? Why does mbstring not get installed to php8.0, and why can't I install mbstring for 8.0? I have googled online and found guides for installing mbstring for 8.0 and this specific command, but I can't see that extension.


More From » apt

 Answers
2

Figured it out thanks to Michal Przybylowicz's comment.


The website's repository: https://launchpad.net/~ondrej/+archive/ubuntu/php needs to be added to Ubuntu's package system. The site lists the commands to do:


sudo add-apt-repository ppa:ondrej/php
sudo apt-get update

I also did:


sudo add-apt-repository ppa:ondrej/apache2


since I run apache2. After that Laravel said that I need the 'dom' extension as well. That was solved by:


sudo apt install php8.0-dom


After that Laravel finally installed! Thanks Michal!


[#1573] Sunday, March 12, 2023, 1 Year  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
giccolla

Total Points: 161
Total Questions: 124
Total Answers: 117

Location: Aland Islands
Member since Wed, Nov 17, 2021
3 Years ago
giccolla questions
Sun, Oct 17, 21, 05:39, 3 Years ago
Mon, Aug 1, 22, 02:00, 2 Years ago
Sun, Nov 21, 21, 08:21, 3 Years ago
;