Hi,
I have an issue I would like some insights into. I am porting a standalone Perl script into a CGI. Part of what the script does is to open an LDAP connection to another server. This script works fine as a standalone script, but fails to connect when it is run as a CGI. I am running Apache 2.2.22. I am running on a Windows 7 machine to debug as localhost:7080. The final target will be a Linux platform running Apache (Lampps).
I am guessing it is a permissions issue but I read elsewhere that Apache ignores permissions on Windows platforms, so any help you can give me would be very appreciated.

The line that is failing is

my $ldap = Net::LDAP->new($host);
The $ldap scalar should be a LDAP object and comes back as an undef.

Update:
I just tried an experiment; instead of trying to open the LDAP connection from the CGI script, I called another Perl script from my CGI (which only opens the connection) using system() call. This works.

I guess that the user apache runs with is not allowed to connect to the ldap network. Using the default system account, when running as service, apache can't connect to networkdrives and UNC paths.
You might check run apache as a different user.

Hi James,
I took your advice and it appears to be working. Took me a little while to figure out how to set up a new user within our company's security structure, but everything looks good now. Thanks for the help.