LDAP konfiguration... ?

All about webserver configurations, PHP and databases.

Moderator: Thorsten

bennniii
Posts: 19
Joined: Tue Sep 07, 2010 10:08 am

LDAP konfiguration... ?

Post by bennniii »

Hallo,

Ich bräuchte unbedingt mal eine "einfache" und verständliche Hilfestellung bei der LDAP Konfiguration.
Und zwar habe ich das Problem, das er das LDAP einfach nicht annehmen will und mit diesen Fehler kommt ->

hpMyFAQ notice [8]: Use of undefined constant LDAP_OPT_PROTOCOL_VERSION - assumed 'LDAP_OPT_PROTOCOL_VERSION' in constants_ldap.php on line 37

phpMyFAQ notice [8]: Use of undefined constant LDAP_OPT_REFERRALS - assumed 'LDAP_OPT_REFERRALS' in constants_ldap.php on line 38

phpMyFAQ warning [2]: session_start() [function.session-start]: Cannot send session cache limiter - headers already sent (output started at C:\Program Files\xampp\htdocs\phpmyfaq\inc\functions.php:173) in index.php on line 50

phpMyFAQ warning [2]: session_regenerate_id() [function.session-regenerate-id]: Cannot regenerate session id - headers already sent in CurrentUser.php on line 296

phpMyFAQ warning [2]: Cannot modify header information - headers already sent by (output started at C:\Program Files\xampp\htdocs\phpmyfaq\inc\functions.php:173) in Session.php on line 380

phpMyFAQ warning [2]: Cannot modify header information - headers already sent by (output started at C:\Program Files\xampp\htdocs\phpmyfaq\inc\functions.php:173) in index.php on line 589

phpMyFAQ warning [2]: Cannot modify header information - headers already sent by (output started at C:\Program Files\xampp\htdocs\phpmyfaq\inc\functions.php:173) in index.php on line 590

phpMyFAQ warning [2]: Cannot modify header information - headers already sent by (output started at C:\Program Files\xampp\htdocs\phpmyfaq\inc\functions.php:173) in index.php on line 591

phpMyFAQ warning [2]: Cannot modify header information - headers already sent by (output started at C:\Program Files\xampp\htdocs\phpmyfaq\inc\functions.php:173) in index.php on line 592

phpMyFAQ warning [2]: Cannot modify header information - headers already sent by (output started at C:\Program Files\xampp\htdocs\phpmyfaq\inc\functions.php:173) in index.php on line 593

phpMyFAQ warning [2]: Cannot modify header information - headers already sent by (output started at C:\Program Files\xampp\htdocs\phpmyfaq\inc\functions.php:173) in index.php on line 594

phpMyFAQ warning [2]: Cannot modify header information - headers already sent by (output started at C:\Program Files\xampp\htdocs\phpmyfaq\inc\functions.php:173) in index.php on line 595



Ich pack nur folgende Datein an...

Selbst erstellte ldap.php Datei im Config Ordner mit folgenden Inhalt: ( Da ich bei der Installation nicht LDAP Aktiviert habe. )

$PMF_LDAP["ldap_server"] = 'Server.domain';
$PMF_LDAP["ldap_port"] = 'port';
$PMF_LDAP["ldap_user"] = 'CN=Service Account von uns,ou=......,ou=......,dc=domain,dc=com';
$PMF_LDAP["ldap_password"] = 'passwort';
$PMF_LDAP["ldap_base"] = 'dc=domain,dc=com';


Und die constants_ldap.php Datei im Ordner Config mit folgenden Inhalt:

<?php
/**
* LDAP constants for phpMyFAQ.
*
* @package phpMyFAQ
* @author Lars Scheithauer <lars.scheithauer@googlemail.com>
* @author Thorsten Rinne <thorsten@phpmyfaq.de>
* @since 2009-08-05
* @version SVN: $Id$
* @copyright 2009 phpMyFAQ Team
*
* The contents of this file are subject to the Mozilla Public License Version
* 1.1 (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
* http://www.mozilla.org/MPL/
*
* Software distributed under the License is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
* for the specific language governing rights and limitations under the
* License.
*/

// Datamapping - in this example for an ADS
$PMF_LDAP['ldap_mapping'] = array (
'name' => 'Service Account', Same -> $PMF_LDAP["ldap_user"] = 'CN=Service Account von uns,ou=......,ou=......,dc=domain,dc=com';
'username' => 'Service Account', Same -> $PMF_LDAP["ldap_user"] = 'CN=Service Account von uns,ou=......,ou=......,dc=domain,dc=com';
'mail' => 'Irgend eine Mail adresse?');

// In a multi-domain environment, users may enter a prefix as domain, e.g. "DOMAIN\username"
// If possible, you should use the Microsoft Glocal Catalog as LDAP-Server, which comes
// with every ADS-Installation.
$PMF_LDAP['ldap_use_domain_prefix'] = true;

// LDAP-options to set
// refer to the documentation of ldap_set_option() for information on available options
$PMF_LDAP["ldap_options"] = array (
LDAP_OPT_PROTOCOL_VERSION => 3,
LDAP_OPT_REFERRALS => 0 );




Irgendwie klappt vorn und hinten nichts... koennte mir jemand dabei helfen? Wie gesagt, in einer vereinfachten Darstellung :) Das wäre super!

Danke!

Gruß
Thorsten
Posts: 15560
Joined: Tue Sep 25, 2001 11:14 am
Location: #phpmyfaq
Contact:

Re: LDAP konfiguration... ?

Post by Thorsten »

Hi,

LDAP-Support ist aber in deinem PHP vorhanden.... der Fehler "Use of undefined constant LDAP_OPT_PROTOCOL_VERSION" sagt eigentlich, dass kein LDAP-Support aktiv ist.

bye
Thorsten
phpMyFAQ Maintainer and Lead Developer
amazon.de Wishlist
bennniii
Posts: 19
Joined: Tue Sep 07, 2010 10:08 am

Re: LDAP konfiguration... ?

Post by bennniii »

Hallo Thorsten,

Danke für deine Hilfe. Was soll ich nun machen? Alles nochmal neu installieren ?


Gruß
Thorsten
Posts: 15560
Joined: Tue Sep 25, 2001 11:14 am
Location: #phpmyfaq
Contact:

Re: LDAP konfiguration... ?

Post by Thorsten »

Hi,

du solltest erstmal LDAP in deinem PHP aktivieren. Wie das geht, steht im PHP Manual.

bye
Thorsten
phpMyFAQ Maintainer and Lead Developer
amazon.de Wishlist
bennniii
Posts: 19
Joined: Tue Sep 07, 2010 10:08 am

Re: LDAP konfiguration... ?

Post by bennniii »

Hallo Thorsten,


Habe ich nun erledigt.
Bekomme dennoch andere Fehler angezeigt.

phpMyFAQ warning [2]: session_start() [function.session-start]: Cannot send session cache limiter - headers already sent (output started at C:\Program Files\xampp\htdocs\phpmyfaq\config\ldap.php:1) in index.php on line 50

phpMyFAQ warning [2]: Cannot modify header information - headers already sent by (output started at C:\Program Files\xampp\htdocs\phpmyfaq\config\ldap.php:1) in Session.php on line 380

phpMyFAQ warning [2]: Cannot modify header information - headers already sent by (output started at C:\Program Files\xampp\htdocs\phpmyfaq\config\ldap.php:1) in index.php on line 589

phpMyFAQ warning [2]: Cannot modify header information - headers already sent by (output started at C:\Program Files\xampp\htdocs\phpmyfaq\config\ldap.php:1) in index.php on line 590

phpMyFAQ warning [2]: Cannot modify header information - headers already sent by (output started at C:\Program Files\xampp\htdocs\phpmyfaq\config\ldap.php:1) in index.php on line 591

phpMyFAQ warning [2]: Cannot modify header information - headers already sent by (output started at C:\Program Files\xampp\htdocs\phpmyfaq\config\ldap.php:1) in index.php on line 592

phpMyFAQ warning [2]: Cannot modify header information - headers already sent by (output started at C:\Program Files\xampp\htdocs\phpmyfaq\config\ldap.php:1) in index.php on line 593

phpMyFAQ warning [2]: Cannot modify header information - headers already sent by (output started at C:\Program Files\xampp\htdocs\phpmyfaq\config\ldap.php:1) in index.php on line 594

phpMyFAQ warning [2]: Cannot modify header information - headers already sent by (output started at C:\Program Files\xampp\htdocs\phpmyfaq\config\ldap.php:1) in index.php on line 595


Wodran liegt das nun? Hast du vielleicht noch einen Tipp?
Welche Datein muss ich modifzieren und mit LDAP Daten füllen?

Vielen Dank!


Gruß
Thorsten
Posts: 15560
Joined: Tue Sep 25, 2001 11:14 am
Location: #phpmyfaq
Contact:

Re: LDAP konfiguration... ?

Post by Thorsten »

Hi,

wie sieht denn deine config.ldap.php Datei aus?

bye
Thorsten
phpMyFAQ Maintainer and Lead Developer
amazon.de Wishlist
bennniii
Posts: 19
Joined: Tue Sep 07, 2010 10:08 am

Re: LDAP konfiguration... ?

Post by bennniii »

<?php
$PMF_LDAP["ldap_server"] = 'Servername.DC.DC.DC';
$PMF_LDAP["ldap_port"] = '389';
$PMF_LDAP["ldap_user"] = 'cn=SA, dc=Peter, dc=petra, dc=com';
$PMF_LDAP["ldap_password"] = 'Passwort vom Service Account';
$PMF_LDAP["ldap_base"] = 'cn=SA, ou=Hochhaus, ou=Haus, ou=Wohnung, dc=peter, dc=petra, dc=com';

SA= Service Account in unserer Domain.
DC= Peter.Petra.com

Bei OU habe ich die Unterordner im Active Directory bis zum Service Account angegeben.


Alles nur nun Beispiele... ersetzten tu ich dies dann mit unseren AD Daten.

Danke!

Gruß
Thorsten
Posts: 15560
Joined: Tue Sep 25, 2001 11:14 am
Location: #phpmyfaq
Contact:

Re: LDAP konfiguration... ?

Post by Thorsten »

Hi,

ist da irgendwo ein Leerzeichen vor dem <?php ? Das besagt der Fehler nämlich...

bye
Thorsten
phpMyFAQ Maintainer and Lead Developer
amazon.de Wishlist
bennniii
Posts: 19
Joined: Tue Sep 07, 2010 10:08 am

Re: LDAP konfiguration... ?

Post by bennniii »

Hallo Throsten,


Danke dir, klappt wunderbar!
Nun das nächste Problem...

phpMyFAQ warning [2]: ldap_bind() [function.ldap-bind]: Unable to bind to server: Invalid credentials in Ldap.php on line 115

phpMyFAQ warning [2]: ldap_search(): supplied argument is not a valid ldap link resource in Ldap.php on line 198

phpMyFAQ warning [2]: ldap_errno() expects parameter 1 to be resource, boolean given in Ldap.php on line 201

phpMyFAQ warning [2]: ldap_error() expects parameter 1 to be resource, boolean given in Ldap.php on line 204

phpMyFAQ warning [2]: ldap_first_entry() expects parameter 1 to be resource, boolean given in Ldap.php on line 207

phpMyFAQ warning [2]: ldap_errno() expects parameter 1 to be resource, boolean given in Ldap.php on line 210

phpMyFAQ warning [2]: ldap_error() expects parameter 1 to be resource, boolean given in Ldap.php on line 212

phpMyFAQ warning [2]: ldap_get_values() expects parameter 1 to be resource, boolean given in Ldap.php on line 215

phpMyFAQ warning [2]: Cannot modify header information - headers already sent by (output started at C:\Program Files\xampp\htdocs\phpmyfaq\inc\functions.php:173) in Session.php on line 380

phpMyFAQ warning [2]: Cannot modify header information - headers already sent by (output started at C:\Program Files\xampp\htdocs\phpmyfaq\inc\functions.php:173) in index.php on line 589

phpMyFAQ warning [2]: Cannot modify header information - headers already sent by (output started at C:\Program Files\xampp\htdocs\phpmyfaq\inc\functions.php:173) in index.php on line 590

phpMyFAQ warning [2]: Cannot modify header information - headers already sent by (output started at C:\Program Files\xampp\htdocs\phpmyfaq\inc\functions.php:173) in index.php on line 591

phpMyFAQ warning [2]: Cannot modify header information - headers already sent by (output started at C:\Program Files\xampp\htdocs\phpmyfaq\inc\functions.php:173) in index.php on line 592

phpMyFAQ warning [2]: Cannot modify header information - headers already sent by (output started at C:\Program Files\xampp\htdocs\phpmyfaq\inc\functions.php:173) in index.php on line 593

phpMyFAQ warning [2]: Cannot modify header information - headers already sent by (output started at C:\Program Files\xampp\htdocs\phpmyfaq\inc\functions.php:173) in index.php on line 594

phpMyFAQ warning [2]: Cannot modify header information - headers already sent by (output started at C:\Program Files\xampp\htdocs\phpmyfaq\inc\functions.php:173) in index.php on line 595


In diesen Fehlermeldungen zeigt er auf eine andere "Ldap.php" Datei. Nicht die im Config Order liegt. Die schreibt sich nämlich mit einem kleinen "l" :)
Welche Datein muss ich mit Ldap informationen füllen?

Welche darf ich nicht anpacken?

Gruß
Thorsten
Posts: 15560
Joined: Tue Sep 25, 2001 11:14 am
Location: #phpmyfaq
Contact:

Re: LDAP konfiguration... ?

Post by Thorsten »

Hi,

deine Fehlermeldung "Invalid credentials" bdeutet, dass die Login-Daten in der config/ldap.php falsch sind.

bye
Thorsten
phpMyFAQ Maintainer and Lead Developer
amazon.de Wishlist
bennniii
Posts: 19
Joined: Tue Sep 07, 2010 10:08 am

Re: LDAP konfiguration... ?

Post by bennniii »

Ja richtig, das habe ich mir auch gedacht.

<?php
$PMF_LDAP["ldap_server"] = 'Servername.DC.DC.DC';
$PMF_LDAP["ldap_port"] = '389';
$PMF_LDAP["ldap_user"] = 'cn=SA, dc=Peter, dc=petra, dc=com';
$PMF_LDAP["ldap_password"] = 'Passwort vom Service Account';
$PMF_LDAP["ldap_base"] = 'cn=SA, ou=Hochhaus, ou=Haus, ou=Wohnung, dc=peter, dc=petra, dc=com';

Kann ich es denn so eingeben? Sonst probier ich noch ca. 100 Verschiedene Sachen aus. :/
Thorsten
Posts: 15560
Joined: Tue Sep 25, 2001 11:14 am
Location: #phpmyfaq
Contact:

Re: LDAP konfiguration... ?

Post by Thorsten »

Hi,

es könnte sein, dass die Leerzeichen in dem Usernamen nicht so richtig sind... ansonsten sollte es auch eine Fehlermeldung beim LDAP-Server geben.

bye
Thorsten
phpMyFAQ Maintainer and Lead Developer
amazon.de Wishlist
bennniii
Posts: 19
Joined: Tue Sep 07, 2010 10:08 am

Re: LDAP konfiguration... ?

Post by bennniii »

Muss ich sonst irgendwas noch mit LDAP Daten abgleichen? Oder ist es NUR diese ldap datei im Config Ordner?

Gruß
Thorsten
Posts: 15560
Joined: Tue Sep 25, 2001 11:14 am
Location: #phpmyfaq
Contact:

Re: LDAP konfiguration... ?

Post by Thorsten »

Hi,

es ist nur diese eine Datei.

bye
Thorsten
phpMyFAQ Maintainer and Lead Developer
amazon.de Wishlist
bennniii
Posts: 19
Joined: Tue Sep 07, 2010 10:08 am

Re: LDAP konfiguration... ?

Post by bennniii »

<?php
$PMF_LDAP["ldap_server"] = 'Servername.DC.DC.DC';
$PMF_LDAP["ldap_port"] = '389';
$PMF_LDAP["ldap_user"] = 'cn=SA, dc=Peter, dc=petra, dc=com';
$PMF_LDAP["ldap_password"] = 'Passwort vom Service Account';
$PMF_LDAP["ldap_base"] = 'cn=SA, ou=Hochhaus, ou=Haus, ou=Wohnung, dc=peter, dc=petra, dc=com';


Kann ich denn die Angaben so machen?
Oder ist die Struktur bzw. dinge anders, die man Angeben soll ? OU z.B.? Funktioniert das?
Post Reply