Install SOAP extension to PHP 7.4

506 Views Asked by At

I try install SOAP extension to Linux Mint 19 Tara. I need version for PHP7.4, which is already working.

sudo apt install php7.4-soap

Result:

Loading package lists… Done
A dependency tree is created
Loading status information... Done
E: Unable to find package php7.4-soap
E: Unable to find package matching mask "php7.4-soap"
E: Unable to find package matching regular expression "php7.4-soap"

PHP7.4 have not SOAP extension or what I am doing wrong?

EDIT:

$ apt-cache search soap | grep "php"
libnusoap-php - SOAP toolkit for PHP
php-soap - SOAP module for PHP [default]
php7.2-soap - SOAP module for PHP

mintupgrade check enter image description here

3

There are 3 best solutions below

6
Alberto Fecchi On

Your OS is too old and not supported by Ondrej PPA anymore.

You can upgrade your OS to a more recent version (suggested as a long-term solution) or try to add this repository (not suggested, always be careful when adding external PPA repositories, especially for old OS):

sudo add-apt-repository ppa:jczaplicki/xenial-php74-temp
sudo apt-get update
sudo apt install php7.4-soap
1
Vaibhav Kumar On

There might be several several cases in this problem. Either your installed php version is not 7.4 or there is already install soap extension with older version which is conflicting or you have php but there is no repo of php libraries in you ubuntu.

First case:

First check your installed php version by

php -v

Second Case:

Remove old version by

sudo apt remove php-soap

Then fix broken packages by

sudo apt --fix-broken install

Now install php7.4-soap by below commands

sudo add-apt-repository ppa:ondrej/php
sudo apt update
sudo apt install php7.4
sudo apt install php7.4-soap
1
Vineesh Vijayan On

The package you are looking for is php7.2-soap, not php7.4-soap. In Linux Mint 19 Tara, the default version of PHP is 7.2.

You can install the PHP SOAP extension for PHP 7.2 by running the following command:

sudo apt install php7.2-soap

After installing the package, you may need to restart your web server for the changes to take effect.