#34533 [Opn->Csd]: LDAP cannot connect when linked against Oracle LDAP libraries
| From: | vrana@php.net | Date: | Tue, 20 Sep 2005 13:42:35 +0000 |
| Subject: | #34533 [Opn->Csd]: LDAP cannot connect when linked against Oracle LDAP libraries | ||
| References: | 1 | Groups: | php.doc |
| Request: | Send a blank email to phpdoc+get-969370236@lists.php.net to get a copy of this message | ||
ID: 34533
Updated by: vrana@php.net
Reported By: liamr at umich dot edu
-Status: Open
+Status: Closed
Bug Type: Documentation problem
Operating System: linux 2.4.31
PHP Version: 5CVS-2005-09-16 (snap)
New Comment:
This bug has been fixed in the documentation's XML sources. Since the
online and downloadable versions of the documentation need some time
to get updated, we would like to ask you to be a bit patient.
Thank you for the report, and for helping us make our documentation
better.
"In order to use Oracle LDAP libraries, proper Oracle environment has
to be set."
Previous Comments:
------------------------------------------------------------------------
[2005-09-16 22:53:00] sniper@php.net
You're just doing it wrong. Works fine for me using this configure
line:
# export ORACLE_HOME=/home/oracle/OraHome_1
# ./configure --disable-all \
'--with-ldap=/home/oracle/OraHome_1
And using the PHP CLI binary on command line, run your script..
Note: I have Oracle 10.1.0.3 libs.
------------------------------------------------------------------------
[2005-09-16 22:49:43] tony2001@php.net
How exactly do you set it and what it's value when you're using full
installs?
Do you get any error messages or something?
------------------------------------------------------------------------
[2005-09-16 22:43:11] liamr at umich dot edu
I am setting ORACLE_HOME in my apache startup script. Doesn't help.
------------------------------------------------------------------------
[2005-09-16 22:36:09] sniper@php.net
I'm reclassifying this as documentation problem.
The solution is quite simple actually. If you'd use
the oracle database functions, they wouldn't work any better either.
You have to ALWAYS set the environment correctly when dealing with
Oracle.
For me, setting ORACLE_HOME was enough.
More information about these environment variables can be found at
http://www.php.net/oci8
There should be a note about this in the LDAP section of the manual..
------------------------------------------------------------------------
[2005-09-16 21:56:23] liamr at umich dot edu
It's not much more complicated, but here..
<pre>
<?php
if (!extension_loaded('ldap')) {
if (!dl('oracleldap.so')) {
exit;
}
}
echo( "<h3>LDAP query test</h3>" );
echo( "Connecting ..." );
$ds=ldap_connect('ldap.itd.umich.edu', 389);
print_r( $ds );
echo( "connect result is ".$ds."<p>" );
if ($ds) {
echo( "Binding ..." );
$r=ldap_bind($ds);
echo( "Bind result is ".$r."<p>" );
echo( "Closing connection" );
ldap_close( $ds );
} else {
echo( "<h4>Unable to connect to LDAP server</h4>" );
}
?>
</pre>
------------------------------------------------------------------------
The remainder of the comments for this report are too long. To view
the rest of the comments, please view the bug report online at
http://bugs.php.net/34533
--
Edit this bug report at http://bugs.php.net/?id=34533&edit=1