Sponsored Content
Top Forums Web Development LDAP Connection Issue on Apache Web Server Post 303004131 by drysdalk on Wednesday 27th of September 2017 02:45:30 AM
Old 09-27-2017
Hi,

Firstly I have to say I'm no PHP expert (to put it mildly), but I suspect this isn't actually a PHP problem.

The first thing I'd recommend is trying to do a bit of extra debugging in your code. From some Googling for this kind of problem, it seems you can enable verbose debugging output in your script by adding a line like this near the top:

Code:
ldap_set_option(NULL, LDAP_OPT_DEBUG_LEVEL, 7);

This should cause the script to display a lot more information about what the LDAP functions are doing, or not doing. I suspect you'll have to have the printing of errors and warnings enabled in your php.ini to actually see that output, though I could be wrong.

If I were to guess myself what's going on, I'd say it's most likely a network connectivity or SSL handshaking issue. So the main thing is to check to see if you can actually connect over standard LDAP to the IP in your script, since as things stand you're attempting a plaintext, non-SSL connection on port 389.

From the Bash prompt, are you able to telnet to the host specified in your script on the same port you're using (i.e. does telnet 1.1.11.111 389 actually work) ? Or on a more advanced but even more useful note, if you have ldap-utils installed you could see what happens if you try ldapsearch -d 1 -H ldap://1.1.11.111.

It could be that your LDAP server is running on a port other than 389 or needs you to use LDAPS rather than plain LDAP. Anyway, hopefully some of the above will give you some pointers in the right direction.
 

9 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Apache Web Server

Hi, Can someone help me for the Apache Web Server files for HP-UX 11.0 systems. Is there any download available? Thanks in Advance Anent (9 Replies)
Discussion started by: anent
9 Replies

2. Solaris

Apache web server question

Hi - Maybe not the right forum for this but I will ask anyway.. I recently installed apache on my ultra 10 - solaris 9... Working okay - and I have some docs in my htdocs directory that I can access through a web browser.. Now I want to get a bit fancy and change the home page so I can... (2 Replies)
Discussion started by: frustrated1
2 Replies

3. Solaris

Configure apache web server for coldfusionmx7

Hi, I have been trying to configure apache web server for coldfusion mx7 on solaris 5.8 using the command: ./wsconfig -server coldfusion -ws apache -dir /usr/local/apache/conf -bin /usr/local/apache/bin/httpd -script /usr/local/apache/bin/apachectl -coldfusion Then it prompted me: Apache... (1 Reply)
Discussion started by: sagolo
1 Replies

4. UNIX for Advanced & Expert Users

remote web server access (apache)

Hi, I have web server (apache) installed in server-1 and i want to view the web pages from diferent servers also while the web server is running only in one server ....(all the servers are connected to office LAN) right now all the servers have apache running......and CPU utilzation is at its... (2 Replies)
Discussion started by: aditya.ece1985
2 Replies

5. Solaris

Uninstall Apache web server

Hello, I have a Solaris 10 and it looks like it was installed with apache. I see some files in: Since I'd like to use CSWapache2 from OpenCSW I'd like to remove the one from SUN but I don't know which package name it has. Do you know how can I remove it ? Thanks R.F ---------- Post... (4 Replies)
Discussion started by: RobertFord
4 Replies

6. Web Development

Apache Web Server Config

Hi Gurus I am a newbie in Apache. I want to configure Apache Web server(A for reference) to receive all requests on Port-843 to be redirected to another Apache web server(B) and access a crossdomain.xml(located in /var/www/html) file there. I have put the following entries in... (0 Replies)
Discussion started by: Hari_Ganesh
0 Replies

7. HP-UX

HP Software depo Apache with LDAP issue

HI guys, I've come to this great community with a problem that everything that I could find is related to a bug, in the ldap code in the apache but nothing else. My problem happens after installing the Apache from HP software depo, it installs sucessfully and everything, but when I setup a... (0 Replies)
Discussion started by: feliper
0 Replies

8. HP-UX

Apache web server instalation error in HP-UX 11.31

Hi , I am getting an error while installing on a new hp-ux 11.31 server for the first time. I have troubleshooted to some extent and installed the C compiler which it was asking for and now a new error has arised. please find the below error, Any help would be appreciated. $ make Making all... (1 Reply)
Discussion started by: Prasad@hp-ux
1 Replies

9. Shell Programming and Scripting

Ldap connection after hosting on Web Server

Hi.. I have very limited knowledge on LDAP and its configuration and but I have been trying to figure out one issue that takes place when I am running the program that is written in php, but so far its unsuccessful. The server, I am working on is ldap server, which is running on Apache. After... (1 Reply)
Discussion started by: GomathiUoM
1 Replies
LDAP_OPEN(3)						     Library Functions Manual						      LDAP_OPEN(3)

NAME
ldap_init, ldap_open - Initialize the LDAP library and open a connection to an LDAP server LIBRARY
OpenLDAP LDAP (libldap, -lldap) SYNOPSIS
#include <ldap.h> LDAP *ldap_open(host, port) char *host; int port; LDAP *ldap_init(host, port) char *host; int port; DESCRIPTION
ldap_open() opens a connection to an LDAP server and allocates an LDAP structure which is used to identify the connection and to maintain per-connection information. ldap_init() allocates an LDAP structure but does not open an initial connection. One of these two routines must be called before any operations are attempted. ldap_open() takes host, the hostname on which the LDAP server is running, and port, the port number to which to connect. If the default IANA-assigned port of 389 is desired, LDAP_PORT should be specified for port. The host parameter may contain a blank-separated list of hosts to try to connect to, and each host may optionally by of the form host:port. If present, the :port overrides the port parameter to ldap_open(). Upon successfully making a connection to an LDAP server, ldap_open() returns a pointer to an LDAP structure (defined below), which should be passed to subsequent calls to ldap_bind(), ldap_search(), etc. Certain fields in the LDAP structure can be set to indicate size limit, time limit, and how aliases are handled during operations. See <ldap.h> for more details. typedef struct ldap { /* ... other stuff you should not mess with ... */ char ld_lberoptions; int ld_deref; #define LDAP_DEREF_NEVER 0 #define LDAP_DEREF_SEARCHING 1 #define LDAP_DEREF_FINDING 2 #define LDAP_DEREF_ALWAYS 3 int ld_timelimit; int ld_sizelimit; #define LDAP_NO_LIMIT 0 int ld_errno; char *ld_error; char *ld_matched; int ld_refhoplimit; unsigned long ld_options; #define LDAP_OPT_REFERRALS 0x00000002 /* set by default */ #define LDAP_OPT_RESTART 0x00000004 /* ... other stuff you should not mess with ... */ } LDAP; ldap_init() acts just like ldap_open(), but does not open a connection to the LDAP server. The actual connection open will occur when the first operation is attempted. At this time, ldap_init() is preferred. ldap_open() will be depreciated in a later release. ERRORS
If an error occurs, these routines will return NULL and errno should be set appropriately. OPTIONS
Options that affect a particular LDAP instance may be set by modifying the ld_options field in the LDAP structure. This field is set to LDAP_OPT_REFERRALS in ldap_open() and ldap_init(), which causes the library to automatically follow referrals to other servers that may be returned in response to an LDAP operation. The other supported option is LDAP_OPT_RESTART, which if set will cause the LDAP library to restart the select(2) system call when it is interrupted by the system (i.e., errno is set to EINTR). This option is not supported on the Macintosh and under MS-DOS. An option can be turned off by clearing the appropriate bit in the ld_options field. NOTES
There are other elements in the LDAP structure that you should not change. You should not make any assumptions about the order of elements in the LDAP structure. SEE ALSO
ldap(3), ldap_bind(3), errno(3) ACKNOWLEDGEMENTS
OpenLDAP is developed and maintained by The OpenLDAP Project (http://www.openldap.org/). OpenLDAP is derived from University of Michigan LDAP 3.3 Release. OpenLDAP 2.1.X RELEASEDATE LDAP_OPEN(3)
All times are GMT -4. The time now is 04:55 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy