Skip to main content

This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.

Archive /

Our old forums are still available as a read-only archive.

Moderators: martimiz, Sean, biapar, Willr, Ingo, simon_w

External Authenticator


Reply


53 Posts   63500 Views

Avatar
xzelan

Community Member, 20 Posts

22 April 2008 at 2:38pm

Edited: 22/04/2008 2:39pm

I'm starting to get the hang of php now ;)

I've put echo statements throughout the code and found that it only gets up to the line:

self::$ds = @ldap_connect($uri, $port);

Does the "@" mean it's an external function call, if not where do I find it so I can continue putting echo statements in?

I've also confirmed that php is definately installed and it has version 5.1.4.4 of the php_ldap.dll file in C:\lighttpd\php\ext\

Avatar
simon_w

Forum Moderator, 474 Posts

22 April 2008 at 3:03pm

"Does the "@" mean it's an external function call, if not where do I find it so I can continue putting echo statements in? "

The @ suppresses error messages generated by the function call. Removing it should display any error messages ldap_connect($uri, $port); is generating.

Avatar
xzelan

Community Member, 20 Posts

22 April 2008 at 3:09pm

Edited: 22/04/2008 3:41pm

Thanks Simon. It's always interesting learning new languages by guess work :D

Anyway, I think this (http://devzone.zend.com/manual/ref.ldap.html) might be relevant:

"LDAP support in PHP is not enabled by default. You will need to use the --with-ldap[=DIR] configuration option when compiling PHP to enable LDAP support. DIR is the LDAP base install directory. To enable SASL support, be sure --with-ldap-sasl[=DIR] is used, and that sasl.h exists on the system.

Note to Win32 Users: In order to enable this module on a Windows environment, you must copy several files from the DLL folder of the PHP/Win32 binary package to the SYSTEM folder of your windows machine. (Ex: C:\WINNT\SYSTEM32, or C:\WINDOWS\SYSTEM). For PHP <= 4.2.0 copy libsasl.dll, for PHP >= 4.3.0 copy libeay32.dll and ssleay32.dll to your SYSTEM folder."

I've now copied libeay32.dll and ssleay32.dll into both system and system32.

And I've downloaded php-5.2.5-win32-installer.msi so now I can hopefully install PHP with LDAP support...

Avatar
lancer

57 Posts

23 April 2008 at 5:13pm

@xzelan

Good work. Let me know how it works out so I can update the wiki (and maybe alter the code to catch non-working connects)

Avatar
xzelan

Community Member, 20 Posts

29 April 2008 at 11:54am

Installing the latest Lighttpd was easy. Installing the latest PHP was ok. Installing the latest MySQL correctly for SilverStripe was too hard for me. I didn't even get to integrating all three and getting SilverStripe running.

Is there any chance of updating SilverStripe's Windows installer to the latest versions?

ie:
Lighttpd from 1.4.10 to 1.4.19
MySQL from 5.0.24 to 5.0.51
PHP from 5.1.4.4 to 5.2.5

Especially as SilverStripe recommends PHP 5.2.0+ (http://doc.silverstripe.com/doku.php?id=server-requirements).

I'm also puzzled that the server requirements page recommends using WAMP when their own Windows installer is a WLMP? (There is a WLMP site but sadly it's only in Hungarian http://en.wlmp-project.net/). Internally SilverStripe seem to prefer Lighttpd so I'm keen to follow their example but am not able.

Avatar
Matt

Core Development Team, 84 Posts

29 April 2008 at 3:28pm

When I worked in a Windows development environment, I used WAMP. We use lighty for the Windows installer because it's smaller and faster than Apache, and at the time SilverStripe was only confirmed as working on Apache, so we wanted to broaden the architectures we knew it supported.

For what it's worth, here at SilverStripe we use LAMP stacks for all our servers, running debian. The remaining few who are still running Windows have either setup Apache/PHP/MySQL themselves or are using WAMP as far as I know.

I'd suggest you setup WAMP and copy your site across - it shouldn't take much effort to get WAMP going.

Matt.

Avatar
xzelan

Community Member, 20 Posts

2 May 2008 at 6:23pm

Edited: 02/05/2008 6:31pm

Thanks Matt.

I got a WAMP working and finally got past the previous sticking point of the blank page :)

However, I now get "Could not bind to LDAP server."

The line of code:

$bind = @ldap_bind(self::$ds, $bindas, $bindpw);

What are your thoughts Lancer?

Avatar
lancer

57 Posts

2 May 2008 at 6:45pm

Wrong credentials? If it can connect, but not bind, it is often a case of a wrong dn or password. Do you have some ldap tools available on your system? (A directory browser would be handy). You can try connect the browser to the AD using the credentials and other settings you've set for the authenticator.

Other policies in the AD may prevent you from connecting as well (e.g. IP based or domain membership based)