[Date Prev][Date Next] [Chronological] [Thread] [Top]

Re: LDAP functions in PHP

Hash: SHA1

Dear Chakravarthy,

> I am using RedHat Enterprise Linux 3 ES, Apache 2.0.48, PHP 4, OpenLDAP
> 2.25.

There is no openLDAP 2.25. There is a version 2.1.25 and there is a version 
2.2.5, so please clarify this.

Furthermore, this is the list for discussing  technical issues with the use of 
openLDAP. If people say you should go to the PHP list, they mean that you 
will probably find answers on PHP related questions.

> I can create entries like cn=xxx, ou=xxxx,o=xxxxx using PHP
> functions. But when I try to add entries like uid=xxx, cn=xxx,
> ou=xxxx,o=xxxx PHP says success. But the entry is not added to the
> database. I can add the similar entries using ldapadd and ldif files.
> Anyone has this problem ? Appreciate any help.

- From this part of your post, I surmise that it's not a PHP problem and not an 
openldap problem, but a problem of how you configured openldap.

With one exception - maybe you are not interpreting the returnvalue that the 
php function gives, correctly. Please check the documentation on php 
carefully, on what type of return value you should expect.

>Sorry about that. I looked at php.net forum also without any success.
> The reason I posted at this forum is it worked fine with prev version of
> openldap and failed in the latest release. I am thinking that I might have
> missed something (thoroughly checked ./configure --help) while compiling
> openldap and thought someone might point it out.  Anyways sorry about that.

You didn't state the version that you were using before, either. Please do so 
in your next post. How are we supposed to know ;-)

Schema checking, Naming context violations and Objectclass violations are to 
worry about. But PHP reads all the errors that openldap gives it and there 
are plenty functions to get the correct error number + error text.

php ldap_add() should never return 'success' if the entry wasn't added. So, 
please start with debugging your phpcode. As you noted before, you can use 


without problems. Hence, your question should really be directed to the PHP 
forums. But if you have any questions about openLDAP, you are welcome to ask 

For better debug levels, please read the man pages for slapd.conf. They will 
give you a good list of debuglevels. If in doubt, use 65535 (or -1) to get 
all debugging output.

Good luck !


website: http://www.suares.nl * http://www.qwikzite.nl
Version: GnuPG v1.2.2-rc1-SuSE (GNU/Linux)