Page 1 of 1

Ports needed for LDAP connection

Posted: Mon Oct 14, 2013 11:48 am
by TheChosenOne
Hi

I have the next set up:
A server (1) that is reachable from the internet and an internal server (2) that is not reachable externally, but can be reached through server 1.
Now. When I run next script on server 1, everything works. 'startsuccess!' is printed.

Code: Select all

<?php
echo "start";
$host = 'server2';
$port = '389;
$ds = ldap_connect($host, $port);
echo "success!";
?>
When I run this on my local pc, it doesn't work.
I forward port 389 to port 1337. This tunnel should work, because portforwarding of other ports (like 22) work.
This is the script I run locally:

Code: Select all

<?php
echo "start";
$host = 'localhost';
$port = '1337;
$ds = ldap_connect($host, $port);
echo "success!";
?>
Only 'start' is printed out.

Am I doing something wrong, or do I have to forward more ports?

Thanks!

Re: Ports needed for LDAP connection

Posted: Mon Oct 14, 2013 2:07 pm
by Celauran
Is this the exact script, including the missing quote after 389? Is error reporting turned on? What errors are you getting?

Re: Ports needed for LDAP connection

Posted: Sun Oct 27, 2013 9:16 pm
by TheChosenOne
Thanks! Error reporting did the trick!
"Call to undefined function: ldap_connect()"
-> Had to install php5-ldap.

Problem solved.