0

I've got a webserver running a few different php versions. Whereas php 8.2 has mbstring installed, I need to install mbstring for php 7.4 as well. However, when trying to install it using sudo apt-get install php7.4-mbstring I receive the following error:

E: Unable to locate package php7.4-mbstring
E: Couldn't find any package by glob 'php7.4-mbstring'
E: Couldn't find any package by regex 'php7.4-mbstring'

I have tried running sudo apt-get update and sudo apt-get upgrade but the installation still fails. I've also tried adding the "universe" repository as described in this thread: Cannot install php-mbstring on ubuntu 18.04 In addition I've also added the ondrej repository sudo add-apt-repository ppa:ondrej/php but again with the result being the same.

None of the proposed answers in the following threads have lead to a solution so far:

The server is running Ubuntu 18.04

Paradonix
  • 78
  • 9
  • Does this answer your question? [Trying to install php-mbstring](https://stackoverflow.com/questions/68545849/trying-to-install-php-mbstring-on-ubuntu-20-04) – OMi Shah Aug 30 '23 at 09:06
  • Also: https://stackoverflow.com/questions/51648156/cannot-install-php-mbstring-on-ubuntu-18-04 – OMi Shah Aug 30 '23 at 09:07
  • Unfortunately not, I've tried the solutions proposed but none of them have worked so far. – Paradonix Aug 30 '23 at 09:24
  • you system packae repository may not have the php7.4-mbstring, run `apt search mbstring` to check it. – LF00 Aug 30 '23 at 09:28
  • Yes you are correct, it only has php7.2-mbstring and php8.2-mbstring. How would I go about adding php7.4-mbstring to the repository? – Paradonix Aug 30 '23 at 09:35
  • add php ppa with `add-apt-repository ppa:ondrej/php` then update the repository with `apt update` then check it with `apt search mbstring` – LF00 Aug 30 '23 at 09:37
  • As described in my question above I've already tried adding that repository and updating it, with no success – Paradonix Aug 30 '23 at 09:42
  • check if you add the ppa success with `ls /etc/apt/sources.list.d/ | grep ondrej-php`. If not show the add process here. – LF00 Aug 30 '23 at 09:51
  • There's no result when running that command. However, when checking the directory the following are shown: ondrej-ubuntu-php-bionic.list ondrej-ubuntu-apache2-bionic.list – Paradonix Aug 30 '23 at 09:56
  • have you run apt update? – LF00 Aug 30 '23 at 10:07
  • Yes, I have done that – Paradonix Aug 30 '23 at 10:13

1 Answers1

1

Ubuntu 18.04 LTS as well as PHP 7.4 have reached EOL (end of life). That means they are no longer supported and you should upgrade.

See the Ubuntu release cycle and PHP Supported Versions. Ubuntu 18.04 reached EOL on May 31, 2023 and PHP 7.4 already on Nov 28, 2022!

The PPA supplied by the wonderful Ondřej Surý only supplies packages for active Ubuntu versions. On his website he states "Don't ask for end-of-life PHP versions or Ubuntu release, they won't be provided."

I recently however had success in updating PHP 7.4 on a Ubuntu 20.04 LTS machine, which is still supported. There is no guarantee how long this will be supported, though.

You need to upgrade to a supported version for your app to continue functioning and to be safe from security issues.

YetiCGN
  • 739
  • 4
  • 10
  • If possible I would like to avoid upgrading to a newer Ubuntu version for now. As for PHP the version needs to be 7.4 since I'm running a TYPO3 v10 installation, which requires PHP 7.4. Unfortunately an update to a newer version is currently not possible due to the missing support for a few extensions. Is it really not possible to install mbstring without upgrading either Ubuntu or PHP? – Paradonix Aug 30 '23 at 09:33
  • There is of course the possibility of compiling it yourself from sources. But I haven't done that in over 15 years... – YetiCGN Aug 30 '23 at 09:37
  • Another thing: Are you aware that TYPO3 v10 has also reached EOL for LTS? Did you purchase ELTS for this installation? Otherwise you are at risk of security issues on all fronts. – YetiCGN Aug 30 '23 at 09:38
  • Thanks, I will try looking into that option. And yes I'm aware of that, the installation has ELTS – Paradonix Aug 30 '23 at 09:44
  • That's good. Maybe you can find a dedicated TYPO3 hoster that still supports 7.4 for TYPO3 10.4 ELTS, if all else fails. – YetiCGN Aug 30 '23 at 09:46