Author Topic: Enable PHP-LDAP extesion in php 5.6 (Centos 6)  (Read 29646 times)

0 Members and 1 Guest are viewing this topic.

Offline
*
Enable PHP-LDAP extesion in php 5.6 (Centos 6)
« on: September 12, 2016, 04:30:59 PM »
I can't seem to figure out how to enable the LDAP extension in php 5.6 - I've tried editing the php.ini to enable teh extension but it doesn't work.  i get en error that the extension doesn't exist:
Code: [Select]
PHP Warning:  PHP Startup: Unable to load dynamic library '/usr/lib64/extensions/no-debug-non-zts-20131226/ldap.so' - /usr/lib64/extensions/no-debug-non-zts-20131226/ldap.so: cannot open shared object file: No such file or directory in Unknown on line 0So following other guides fr php I've found "yum install php-ldap", but unfortunately that appears to have installed ldap support for php 5.3 (I need 5.6).

How to do install/enable this ldap extension for 5.6?

Thanks!

Offline
*
Re: Enable PHP-LDAP extesion in php 5.6 (Centos 6)
« Reply #1 on: September 12, 2016, 04:40:30 PM »
To add to this - I found on the PHP documentation the following:
Quote
LDAP support in PHP is not enabled by default. You will need to use the --with-ldap[=DIR] configuration option when compiling PHP to enable LDAP support. DIR is the LDAP base install directory.

Now I know I can recompile php in the PHP Selector, and I could add that configuration option, but how do I know what the LDAP base install directory is?

Thanks again!

Offline
*
Re: Enable PHP-LDAP extesion in php 5.6 (Centos 6)
« Reply #2 on: September 21, 2016, 01:41:41 PM »
So hopefully with a little more info someone can help.

Here is my php path and version:
Code: [Select]
[root@D-APP03 /]# which php
/usr/local/bin/php
[root@D-APP03 /]# cd /usr/local/bin/
[root@D-APP03 bin]# ./php -v
PHP 5.6.25 (cli) (built: Aug 31 2016 14:34:48)
Copyright (c) 1997-2016 The PHP Group
Zend Engine v2.6.0, Copyright (c) 1998-2016 Zend Technologies

And I tried a ./configure (from the path /tmp/php-build/php-5.6.25/ - not sure that's the right path) with the following:
Code: [Select]
./configure
--prefix=/opt/alt/php56/usr
--with-zlib
--enable-soap
--enable-exif
--with-config-file-path=/opt/alt/php56/usr/php
--with-config-file-scan-dir=/opt/alt/php56/usr/php/php.d
--enable-phar
--enable-bcmath
--enable-calendar
--with-curl
--with-iconv
--with-mysql
--with-mysqli
--with-mysql=mysqlnd
--with-mysqli=mysqlnd
--with-mcrypt
--with-gettext
--with-xsl
--with-xmlrpc
--with-pdo-mysql=mysqlnd
--enable-posix
--enable-ftp
--with-openssl
--enable-mbstring
--with-jpeg-dir=/usr
--with-freetype-dir=/usr
--with-kerberos
--with-xsl
--with-bz2
--enable-sockets
--enable-zip
--with-gd
--with-imap
--with-imap-ssl
--enable-sockets
--with-pcre-regex
--libdir=/usr/lib64
--with-mysql-sock=/var/lib/mysql/mysql.sock
--with-ldap
--with-libdir=lib64

Then I did a make, and make install from the same path.
Then restarted Apache

And a php -v still shows the same version that states "built: Aug 31 2016 14:34:48"
And php -m lists all the modules, but LDAP is not in the list.

What am I doing wrong?
Thanks!

Steve

Offline
*
Re: Enable PHP-LDAP extesion in php 5.6 (Centos 6)
« Reply #3 on: November 16, 2016, 10:48:23 AM »
So hopefully with a little more info someone can help.

Here is my php path and version:
Code: [Select]
[root@D-APP03 /]# which php
/usr/local/bin/php
[root@D-APP03 /]# cd /usr/local/bin/
[root@D-APP03 bin]# ./php -v
PHP 5.6.25 (cli) (built: Aug 31 2016 14:34:48)
Copyright (c) 1997-2016 The PHP Group
Zend Engine v2.6.0, Copyright (c) 1998-2016 Zend Technologies

And I tried a ./configure (from the path /tmp/php-build/php-5.6.25/ - not sure that's the right path) with the following:
Code: [Select]
./configure
--prefix=/opt/alt/php56/usr
--with-zlib
--enable-soap
--enable-exif
--with-config-file-path=/opt/alt/php56/usr/php
--with-config-file-scan-dir=/opt/alt/php56/usr/php/php.d
--enable-phar
--enable-bcmath
--enable-calendar
--with-curl
--with-iconv
--with-mysql
--with-mysqli
--with-mysql=mysqlnd
--with-mysqli=mysqlnd
--with-mcrypt
--with-gettext
--with-xsl
--with-xmlrpc
--with-pdo-mysql=mysqlnd
--enable-posix
--enable-ftp
--with-openssl
--enable-mbstring
--with-jpeg-dir=/usr
--with-freetype-dir=/usr
--with-kerberos
--with-xsl
--with-bz2
--enable-sockets
--enable-zip
--with-gd
--with-imap
--with-imap-ssl
--enable-sockets
--with-pcre-regex
--libdir=/usr/lib64
--with-mysql-sock=/var/lib/mysql/mysql.sock
--with-ldap
--with-libdir=lib64

Then I did a make, and make install from the same path.
Then restarted Apache

And a php -v still shows the same version that states "built: Aug 31 2016 14:34:48"
And php -m lists all the modules, but LDAP is not in the list.

What am I doing wrong?
Thanks!

Steve
i facing the same problem are you solve this problem if solve than please update me how

Offline
*
Re: Enable PHP-LDAP extesion in php 5.6 (Centos 6)
« Reply #4 on: November 16, 2016, 11:15:02 AM »
Is this problem resolve or not if so than please tell me how i facing the same problem i can't enable ldap support

Offline
*
Re: Enable PHP-LDAP extesion in php 5.6 (Centos 6)
« Reply #5 on: March 04, 2017, 08:43:53 AM »
I solve this problem by using PHP Version Switcher on CWP dashboard.

Select your php environment and add argument "--with-ldap" on PHP Compiler, than press start compiler.

I hope this can help you.

Thanks,

Oka
oka.gartria@sandatindo.com
www.sandatindo.com