Score:1

I'm unable to install PHP packages for Apache configuration

ke flag

Sorry about that,this is what I'm getting when attempting to install the following packages, any inputs will be much appreciated.

yael@ypa-ubuntu-server:~$ sudo apt install php7.2 libapache2-mod-php7.2 php7.2-common php7.2-mbstring php7.2-xmlrpc php7.2-soap php-apcu php-smbclient php7.2-ldap php-redis php7.2-gd php7.2-xml php7.2-intl php7.2-json php-imagick php7.2-mysql php7.2-cli php7.2-ldap php7.2-zip php7.2-curl
[sudo] password for yael: 
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
Package libapache2-mod-php7.2 is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source

Package php-smbclient is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source

Package php7.2-common is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source

E: Unable to locate package php7.2
E: Couldn't find any package by glob 'php7.2'
E: Package 'libapache2-mod-php7.2' has no installation candidate
E: Package 'php7.2-common' has no installation candidate
E: Unable to locate package php7.2-mbstring
E: Couldn't find any package by glob 'php7.2-mbstring'
E: Unable to locate package php7.2-xmlrpc
E: Couldn't find any package by glob 'php7.2-xmlrpc'
E: Unable to locate package php7.2-soap
E: Couldn't find any package by glob 'php7.2-soap'
E: Package 'php-smbclient' has no installation candidate
E: Unable to locate package php7.2-ldap
E: Couldn't find any package by glob 'php7.2-ldap'
E: Unable to locate package php7.2-gd
E: Couldn't find any package by glob 'php7.2-gd'
E: Unable to locate package php7.2-xml
E: Couldn't find any package by glob 'php7.2-xml'
E: Unable to locate package php7.2-intl
E: Couldn't find any package by glob 'php7.2-intl'
E: Unable to locate package php7.2-json
E: Couldn't find any package by glob 'php7.2-json'
E: Unable to locate package php7.2-mysql
E: Couldn't find any package by glob 'php7.2-mysql'
E: Unable to locate package php7.2-cli
E: Couldn't find any package by glob 'php7.2-cli'
E: Unable to locate package php7.2-ldap
E: Couldn't find any package by glob 'php7.2-ldap'
E: Unable to locate package php7.2-zip
E: Couldn't find any package by glob 'php7.2-zip'
E: Unable to locate package php7.2-curl
E: Couldn't find any package by glob 'php7.2-curl'

I tried apt policy [one of the missing packages] for a couple of them and this is what I got.

yael@ypa-ubuntu-server:~$ apt policy php7.2
N: Unable to locate package php7.2
N: Couldn't find any package by glob 'php7.2'
yael@ypa-ubuntu-server:~$ apt policy php7.2
N: Unable to locate package php7.2
N: Couldn't find any package by glob 'php7.2'
yael@ypa-ubuntu-server:~$ apt policy libapache2-mod-php7.2
libapache2-mod-php7.2:
  Installed: (none)
  Candidate: (none)
  Version table:
yael@ypa-ubuntu-server:~$ apt policy php7.2-common
php7.2-common:
  Installed: (none)
  Candidate: (none)
  Version table:
yael@ypa-ubuntu-server:~$ apt policy php7.2-mbstring
N: Unable to locate package php7.2-mbstring
N: Couldn't find any package by glob 'php7.2-mbstring'
Organic Marble avatar
us flag
Please edit your question and use code formatting, it's unreadable in its current state. Including the output of `apt policy [one of the missing packages]` would be helpful.
in flag
Which version of Ubuntu Server are you installing PHP on? If it’s a recent version, there is no need to specify 7.2. If you specifically need 7.2 and it’s not the default for that Ubuntu installation, that’s a different issue
Yael Palacios avatar
ke flag
@OrganicMarble thanks a lot, first time user here if you couldn't tell. I just edited it with your recommendation.
Yael Palacios avatar
ke flag
@matigo thanks a lot! 21.04, so can I just remove the 7.2 from my items listed there?
in flag
Ubuntu Server 21.04 repositories will install PHP 7.4. So long as this is acceptable for your situation, all you need to do is remove the `7.2` bits from your previous `apt install`. If you *must* use 7.2, then you’ll need either a 3rd-party repository or a Docker container
Yael Palacios avatar
ke flag
@matigo Thanks again, that did it :) I'm now getting this: E: Package 'php-smbclient' has no installation candidate so I'd say that's progress!
Nmath avatar
ng flag
are you remembering to run `sudo apt update` before trying to install software? If you are not working with the current list of packages, you risk ending up in dependency hell, which is what this looks like.
Score:0
zw flag

The php-smbclient was last available for 18.04 LTS officially.

To get it on 21.04 you have to use PPA:

sudo apt-get install software-properties-common

sudo add-apt-repository ppa:jnweiger/php-smbclient
sudo apt-get update
sudo apt-get install php-smbclient

Also please note that it is recommended to run LTS versions (like 18.04 LTS or 20.04 LTS) for reliable long-term server installations.

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.