Taylor Jones
Taylor Jones

Reputation: 108

Installing php-ldap on CentOs

I have an unmanaged VPS server preinstalled with CentOs 6.6 and WHM/CPanel. I am trying to install php-ldap but it just says package not found. I have not been able to find anywhere what repository it should be in. How can I install ldap on my server to work with php 5.4? I am trying to manage Windows Server 2012 R2 Active Directory.

root@vps [~]# yum install php-ldap
Loaded plugins: fastestmirror, security
Setting up Install Process
Loading mirror speeds from cached hostfile
 * base: mirror.5ninesolutions.com
 * epel: fedora-epel.mirror.lstn.net
 * extras: centos.arvixe.com
 * updates: pubmirrors.dal.corespace.com
No package php-ldap available.
Error: Nothing to do
root@vps [~]#

Upvotes: 3

Views: 31250

Answers (3)

sx3
sx3

Reputation: 23

Get the php version you are running by

php -v

if not worked try

rpm -qa |grep php

if the php version is 5.4 then use

sudo yum install php54w-ldap

if 5.6

sudo yum install php56w-ldap

and so on.

Upvotes: 0

Remi Collet
Remi Collet

Reputation: 7041

On a cpanel serveur you probably have an "exclude" line in yum.conf (see I can't install any package related to PHP with yum) which prevent you to install/upgrade php from another repository.

To see the provider of "php", user this command

rpm -qf $(which php) 

And the ldap extension, if available will be in the same namespace.

Notice switch the php stack from the cpanel provider to another repo can break it.

Upvotes: 1

Machavity
Machavity

Reputation: 31654

You need to understand that the base repos typically don't contain boutique builds for PHP. Your best bet is to install a different repo, like the Remi repo, which does contain that RPM.

While I'm at it, PHP 5.4 went End-of-life 4 days ago. Remi offers 5.5 and 5.6 so you should consider upgrading

Upvotes: 0

Related Questions