Stuart Dyer's picture

Trying to install php ldap, getting an error that debian cannot locate the package


root@observium /home/admin# sudo apt-get update
Hit jessie/updates InRelease
Ign jessie-security InRelease
Ign jessie InRelease
Hit jessie/updates/main amd64 Packages
Hit jessie-security Release.gpg
Ign jessie InRelease
Hit jessie Release.gpg
Hit jessie Release.gpg
Hit jessie Release
Hit jessie/updates/contrib amd64 Packages
Hit jessie/updates/contrib Translation-en
Hit jessie/updates/main Translation-en
Hit jessie/main amd64 Packages
Hit jessie-security Release
Hit jessie Release
Hit jessie/contrib amd64 Packages
Hit jessie/contrib Translation-en
Hit jessie/main Translation-en
Hit jessie-security/main amd64 Packages
Hit jessie/main amd64 Packages
Ign jessie-security/main Translation-en
Ign jessie/main Translation-en
Reading package lists... Done
W: There is no public key available for the following key IDs:


root@observium /home/admin# sudo apt-get install php-ldap
Reading package lists... Done
Building dependency tree
Reading state information... Done
E: Unable to locate package php-ldap


checked this website and this is the command they advise to run

Stuart Dyer's picture

needed to run


sudo apt-get install php5-ldap

Jeremy Davis's picture

As you've discovered, in Jessie (TurnKey v14.x) the PHP packages are all (mostly) named php5-XXXX (where 'XXXX' is the module name). In Stretch onwards there are metapackages named php-XXXX which depend on the real packages which include the full PHP version (which you can install directly if you'd rather for some reason, but installing the meta package is recommended). I.e. on v16.x (based on Debian Buster) 'php-ldap' will install 'php7.3-ldap'.

Installing the module (and probably restarting Apache) should be all you need to do to get it working. I.e.:

service restart apache2

If you want to double check, then you can create a phpinfo file that you can then double check in your browser. Generally writing this into the web root of your appliance should do the trick, but some appliances may be a little tricker, some because they have rewrite rules that might block the file, in others becuase they are organised a little differently, or sometimes both. In the case of Observium, I'm not 100% sure, but you can try like this:

echo '' > /opt/observium/html/phpinfo.php

Then see if in your browser you can load: http://YOUR_SERVER_IP_OR_FQDN/phpinfo.php

If you can, then you should be able to see the detailed info of all the modules and config for PHP.

Add new comment