Connect an active directory or LDAP with PHP

2

I am trying to connect the active directory or LDAP of the window with an application ( GLPI ) made in PHP.

Connection parameters:

$ds = ldap_connect($host, $port) // me retorna verdadero

@ldap_set_option($ds, LDAP_OPT_PROTOCOL_VERSION, 3);

@ldap_set_option($ds, LDAP_OPT_REFERRALS, 0);

@ldap_set_option($ds, LDAP_OPT_DEREF, $deref_options);

Relate connection to server and user and password

ldap_bind($ds, $login, $password) returns me:

  

"Can not contact LDAP server" (I can not contact the LDAP server)

I want to know what can happen with that error message, since in the first method it returns true to me, which means that if it connects to the server.

RootDN It's ok and it has all the permissions the user I'm using.

The default server is fine since I made it ping and telnet .

Please, if you can help me, thank you very much.

Note: I already downloaded LDAPExplorer and established a connection without problem.

    
asked by Alberto Mira 10.12.2018 в 21:12
source

1 answer

3

Ok, the solution to my problem is to upgrade from GLPI version 9.3.0 to 9.3.3.

Suggestions:

  • For the users, what could happen to this, verify the messages that GLPI has informs of pending packages of installation. So I opted for the update and the connection worked without problem.

  • For users who can not update version, verify that apache packages are pending to install or update, also in the installation process in the setup, be very careful installing the entire list that It seems pending.

To fix some errors by installing version 9.3.3:

chown -R apache:apache glpi/files

chmod -R 755 glpi/files

chown -R apache:apache config

chmod -R 755 glpi/config

also:

setsebool -P httpd_can_network_connect_db 1
    
answered by 13.12.2018 / 17:22
source