Authentication

 
 
Picture of chris johnson
PHP LDAP module does not seem to be present
 

I'm a moodle newbie, and installed Moodle 1.5.2 on Windows 2003 server using Easy PHP from http://moodle.org/doc/?file=installamp.html#windows.  The install worked well, and I was able to log on.  I went to switch the authentication method to LDAP, and received the following message:

Warning: The PHP LDAP module does not seem to be present. Please ensure it is installed and enabled.

I uncommented extension=php_ldap.dll in the php.ini file in c:\program files\easyphp1-7\apache, thinking that would solve the problem.  I also specified the extensions directory c:\program files\easyphp1-7\php\extentions\.

Now when I start easy.php, I recieve a Windows dialog box that says apache.exe - unable to locate component.  The message is "This application has failed to start because SSLEAY32.dll was not found.  Re-installing the application may fix this problem." 

Then I get a second dialog box that says "Unknown(): Unload to load dynamic library 'C:\Program Files\EasyPHP1-7\php\extensions\php_ldap.dll' - The specified module could not be found."

TIA!

 
Average of ratings: -
Picture of chris johnson
Re: PHP LDAP module does not seem to be present
 
Fixed, I added my PHP directory to my Windows Path.
 
Average of ratings: -
Picture of Lars Jensen
Re: PHP LDAP module does not seem to be present
 
Hi Chris,

We're trying to test ldap authentication on a windows installation of moodle, with Easyphp, and we ran into the same problem with the ldap module not being present. We tried to include the php directory in the windows path, but this didn't fix it. How exactly did you fix this?

Thanks,
Lars.
 
Average of ratings: -
Picture of Iñaki Arenaza
Re: PHP LDAP module does not seem to be present
Group DevelopersGroup Documentation writersGroup Particularly helpful Moodlers
One way you may solve it is by copying SSLEAY32.dll in C:\WINDOWS\SYSTEM32. That way PHP & Apache will be able to find the DLL and load it.

Saludos. Iñaki.
 
Average of ratings: -
Picture of Luke Lee
Re: PHP LDAP module does not seem to be present
 

hi, I having an issue for this also.  LDAP server is disabled for my case. This is on the server and its not local host. How can I install or enable it?


 
Average of ratings: -
Picture of Kent Sweigart
Re: PHP LDAP module does not seem to be present
 
Chris,

I'm at the same place you were in October.

I added the Windows Path to the php.ini and the error goes away, but I still get the Warning: The PHP LDAP module does not seem to be present. Please ensure it is installed and enabled. when going to set up LDAP.

Any clues?

Kent
 
Average of ratings: -
Picture of Csaba Vágvölgyi
Tárgy: Re: PHP LDAP module does not seem to be present
 
Just one idea:
Try to remove ; (comment sign) from the line
;extension=php_ldap.dll
in the php.ini file and then restart Apache!

Csaba
 
Average of ratings: -
Picture of Stephan Unknown
Re: PHP LDAP module does not seem to be present
 
I've got the same error and did all the things mentioned in this thread. I've put the 2 dll's in my /System32/ directory and removed the ';' character in front of the extension=php_ldap.dll, but he still nags about it. When typing in "php -m" on the command line it indicates that ldap is installed. What more could be wrong?

I'm using the following versions:

Xampp with:
Apache 2
MySql 5
Php 5

Moodle 1.53

 
Average of ratings: -
Picture of Iñaki Arenaza
Re: PHP LDAP module does not seem to be present
Group DevelopersGroup Documentation writersGroup Particularly helpful Moodlers
Login as admin into Moodle, and go to http://my.moodle.site/admin/phpinfo.php and check that the ldap extension is listed on the generated page.

If it's not there, then you'll have to check php.ini, your PATH variable, that you have copied the DLLs in System32 and then restart Apache to apply any changes you may have done.

Saludos. Iñaki.
 
Average of ratings: -
Picture of Ian Scott
Re: PHP LDAP module does not seem to be present
 

I'm on a fresh install of PHP 5.1.2 using IIS6 Windows 2003 - I followed the directions to install PHP manually and all worked except LDAP.

I've placed the two necessary DLL files in both the System 32 directory and within the PHP directory (as recomended) - set system path. Uncommented LDAP in the .ini file - even tested putting a comment on JAVA to see if I could make it stop (which it did) - sooo - LDAP doesn't report as operational with <?php phpinfo(); ?> - any ideas out there?

I tried Iñaki's method of using ldaptest but there is no error report - probably moodle setup stomping on it.

I've got Softerra's LDAP browser working so I know the correct settings to get the LDAP info.

No idea how to proceed.

 
Average of ratings: -
Picture of Steve Power
Re: PHP LDAP module does not seem to be present
 

I had similar problems with my setup. In the end I found something in an adode forum which told me to move the php.ini file into the c:\windows folder. having done this it worked.

So much for Open Source being quirky Microsoft have it down to a fine art.

Hope this helps.

Regards
Steve

 
Average of ratings: -
Picture of Ian Scott
Re: PHP LDAP module does not seem to be present
 

Solved - thought I had done everything - followed all suggestions - decided I would check everything - clue was cmd php -m didn't work from cmd line until I went into php diectory - I had lost (never put in?) the php directory in the system variable path - once added ldap worked.

Find it strange that everything worked except this one process but then it is windows ;)

 
Average of ratings: -
Picture of Edward Goytia
Re: PHP LDAP module does not seem to be present
 
I'm a Moodle newbie who's been experiencing exactly the same problem except I'm not getting the same reults you are. I've edited the php.ini file, updated the path variables in Windows and even copied over the php.ini and php_ldap.dll files into the System32 directory but I still get that little red error when trying to configure LDAP in Moodle. php -m says the module is loaded but it doesn't appear in the phpinfo readout so clearly something's still off.  Any ideas on what I might be missing?
 
Average of ratings: -
Picture of George Martini
Re: PHP LDAP module does not seem to be present
 

I too have tried all the suggestions.  Nothing would work.

I initially used the Windows package that had everything needed.  I could not get this to work.  I finally downloaded and installed EasyPHP.  Then I installed Moodle.  It worked!

Hope this helps.

 
Average of ratings: -
Picture of George Martini
Re: PHP LDAP module does not seem to be present
 

I still cannot get LDAP working:

I have a Windows XP "test" machine setup using the pre-packaged Moodle Windows installation.  Like most everyone else, it installs fine and I can logon with manual accouts.  I NEED to get LDAP auth to work.  I have tried ALL the suggestions in this post.  I still get:

"Warning: The PHP LDAP module does not seem to be present. Please ensure it is installed and enabled"

php -m and phpinfo both report the ldap module(s) as being installed.

I installed Moodle on a test XP machine for speed of install.  This is not the platform I intent to use for production...if I get that far.

Any additional suggestions would be greatly appreciated!

 
Average of ratings: -
Picture of Scott Hardwick
Re: PHP LDAP module does not seem to be present
 

Having had the same troubles as many of the others in this thread, I wanted to let you know how I solved the PHP ldap module problem.

I am running Windows 2003 and am using the Windows Moodle Quick Installer

1. I had to put the php path in my environment path variable in windows 2003.
   To check to see if yours works before beginning, do start, run, cmd and enter
   Type php -m, you should see output, if not you need to set the path
   To see what your path currently is, type path and hit enter

   To set the path on Windows 2003, go to the control panel and click on System.  Then click on the advanced tab and you should see at the bottom a button for environment variables, click that. You now have a box where you can edit several things including your path.

(Keep in mind that if you use %SystemRoot% in you php path that it does NOT point to c:\, instead to c:\Windows\)

2. I had to alter the PHP.ini file.
   Interestingly enough, I kept thinking I had done this. It turns out that at least on my system, I have two php.ini files and one php5.ini.  To find out which one your system is actually using, login to moodle as the administrator, go to the admin page and at the very bottom press the php Info button. About the seventh line down you should see something like this:

Configuration File (php.ini) Path  C:\moodle\apache\bin\php.ini 

Open and edit that file and remove the semicolon (;) in front of the line :
extension=php_ldap.dll

3. After these two things restart apache and you should no longer receive the red error message.

Scott

 
Average of ratings:Useful (1)
Picture of Peter Howarth
Re: PHP LDAP module does not seem to be present
 

Aha!  Finally!

Scott's reply helped me solve my problem.

Anyone else reading this, make sure you are editing the correct PHP.ini...!  Using Scott's method (Log into moodle as Admin, go to Admin page, click 'PHP Info' button, few lines down it gives location of configuration file) I realised that of the three I had been editing, none of them was correct.

If you use the Moodle full install (PHP/Apache/MySQL) the php.ini you need is in

%moodle%/apache/bin/php.ini (where %moodle% is where you've installed moodle to.

HTH,

Peter.

 
Average of ratings: -
Picture of Mike O'Connell
Re: PHP LDAP module does not seem to be present
 
Hey all,
         Let me start by saying that Im a complete newbie at moodle and LDAP (havent even heard of them before 2 weeks ago).
Anyway, Im getting the same problem as above
"Warning: The PHP LDAP module does not seem to be present. Please ensure it is installed and enabled."
and if I then try to log on as one of the users I get
"
Fatal error: Call to undefined function: ldap_connect() in /var/www/moodle/auth/ldap/lib.php on line 1298" (i take it that error pops up because of the warning in red).

unlike the other people who replied on this thread I'm using Linux, so does anyone have a solution for this problem using Linux?

Thanks
Mike
 
Average of ratings: -
Picture of David Willington
Re: PHP LDAP module does not seem to be present
 
Morning Mike

I'm using Linux and have it working. It looks like php doesn't have ldap support, so the ldap_connect() function isn't available. You can find out if this is the case by looking at the output of phpinfo();. You can do this by putting the following script into your moodle directory and browsing to it

<?php
phpinfo();
?>

You should get a lot of useful information, including a section about ldap. If ldap support isn't enabled / installed you'll need to add it to php either by recompiling php or using your package manager.

Hope this helps

David
 
Average of ratings: -
Picture of Mike O'Connell
Re: PHP LDAP module does not seem to be present
 
by phpinfo(); do you mean the PHP info page in the admin part of moodle? That page does have a  file named "/etc/php4/apache2/php.ini" as a configuration file path. But nowhere on that page can I see any mention of LDAP.

So does that mean it isnt present?

Sorry if this is a stupid quesetion

thanks
Mike
 
Average of ratings: -
Picture of David Willington
Re: PHP LDAP module does not seem to be present
 
Yes that's the one. I'd not spotted it as part of moodle, but there shouldn't be any need to upload an additional script. On my test server it's at

http://moodle.local/admin/phpinfo.php

I've got a section called ldap with a table with 6 or so bits of information in. If you can't see ldap anywhere on that page, it's not installed, and you won't get any further until it is installed.

If you're compiling from source, you need (if I remember correctly) to use

./configure --with-ldap

at the configuration stage, but check this. Alternatively I think you might be able to get an rpm which will add ldap support if you're using Fedora. Try a google search

David
 
Average of ratings: -
Picture of Mike O'Connell
Re: PHP LDAP module does not seem to be present
 
I've got a section called ldap with a table with 6 or so bits of information in. If you can't see ldap anywhere on that page, it's not installed, and you won't get any further until it is installed.

Well this is the problem then. I'm going to have to talk with the guy who installed moodle on the machines, hopefully ill figure out how to set all this up.

Thanks again
Mike
 
Average of ratings: -
Picture of Mike O'Connell
Re: PHP LDAP module does not seem to be present
 
I dont know how to edit my previous post, so I'll just post again. Im using Ubuntu, so should I look for a different method or program to get the LDAP installed/working?
 
Average of ratings: -
Picture of David Willington
Re: PHP LDAP module does not seem to be present
 
I use Fedora which I'm pretty sure installs php with ldap support by default. I've never used Ubuntu/Debian, but I understand the forums are very good. I'd be inclined to try there to see how you can add ldap support to php. I've also compiled from source which often goes very smoothly. The trick always seems to be to give up if it doesn't and try a different version of the various bits of software. Alternatively look at the versions of Apache and php that are installed with Ubuntu and compile those with php support added

David
 
Average of ratings: -
Picture of Iñaki Arenaza
Re: PHP LDAP module does not seem to be present
Group DevelopersGroup Documentation writersGroup Particularly helpful Moodlers
If you are using Ubuntu, just install the 'php4-ldap' package and make sure it's activated in /etc/php4/apache2/php.ini once you install it (it should by default).

Saludos. Iñaki.
 
Average of ratings: -
Picture of Mike O'Connell
Re: PHP LDAP module does not seem to be present
 
Dude you are a lifesaver. I have spent the last two days looking a php code thinking I had to set up a module for this. After 30min searching I found out how to use php4-ldap.

"sudo apt-get install php4-ldap"
"sudo apache2ctl graceful"

I got it from here


Thanks again to everyone who gave help

Mike
 

 
Average of ratings: -
Picture of Mike O'Connell
Re: PHP LDAP module does not seem to be present
 
Great, now Im getting the error;

ldap_bind(): Unable to bind to server: Invalid credentials in /var/www/moodle/auth/ldap/lib.php on line 1308


edit;
The code around this line reads;

 if (!empty($binddn)){
            //bind with search-user
            //$debuginfo .= 'Using bind user'.$binddn.'and password:'.$bindpwd;
            $bindresult=ldap_bind($connresult, $binddn,$bindpwd);
        } else {
            //bind anonymously
            $bindresult=@ldap_bind($connresult);
        } 


So I guess its a problem with my bind settings

 
Average of ratings: -
Picture of Oliver Jackson
Re: PHP LDAP module does not seem to be present
 
Invalid credentials on line 1308 almost certainly means that your $binddn and $bindpwd are not a valid authentication pair.

I eventually got ldap authentication working with MS Active Directory with a ldap_bind_dn of the form
cn=<adminUserName>,ou=<adminGroup>,dc=myDomain,dc=qld,dc=edu,dc=au
and ldap_bind_pw is adminUsername's password of course.

The biggest hurdle i had to overcome was getting the ldap_host_url in the correct form.  The ldap auth setup page reccommends a proper URL format however I found that a simple server and port notation worked for me...
<msADServer>:389
Where port 389 is the default ldap port on a MS AD Server.
Also had to set the ldap version to 3.
 
Average of ratings: -
Picture of Mike O'Connell
Re: PHP LDAP module does not seem to be present
 
Wow, I got it working, thanks .



I had used administrator as a bind user before, but as I just noticed whoever set up the server did not give an openad logon name to him. So I gave him a name, then put that name and password into the bind_dn and bind_pw and it worked.

So was I supposed to use his password to bind?

edit; forgot to say how thankful I am, I spent ages on this LDAP thing. Its great to finally have it running.



 
Average of ratings: -
Picture of John Hawkins
Re: PHP LDAP module does not seem to be present
 

I had the same problem as listed and performed all of the steps everyone had suggested, and was unsuccessful. However, I did fix the issue. The resolution is to edit the "php.ini" that is located in the apache\bin folder. I removed the comment from the extension=php_ldap.dll.

 
Average of ratings: -
Picture of thai trung
Re: PHP LDAP module does not seem to be present
 
I got the same problem: "The PHP LDAP module does not seem to be present..." on windows 2K SP4, MySQL 5.0.15, PHP 5.1.4. I copied php_ldap.dll to PHP folder "C:\php" ; ssleay32.dll and libeay32.dll to C:\winnt\system32 folder then thanks god it worked.
 
Average of ratings: -
Picture of Rob potts
Re: PHP LDAP module does not seem to be present
 

Hi

I am running php 4.4.4 and IIS 6 at the minute and keep getting the Warning about the LDAP module not being installed and Enabled does anyone have any idea how to get this working as just uncommenting the line seems to make no difference.

Thanks

Robert

 
Average of ratings: -
Picture of Iñaki Arenaza
Re: PHP LDAP module does not seem to be present
Group DevelopersGroup Documentation writersGroup Particularly helpful Moodlers
If you have PHP installed as an ISAPI module, you need to restart IIS for the changes to take effect.

Saludos. Iñaki.
 
Average of ratings: -
Picture of Rob potts
Re: PHP LDAP module does not seem to be present
 

Got it working now but recive an error telleing me that on line 1213 of LDAP/lib.php there is an confermation error

 
Average of ratings: -
Picture of Iñaki Arenaza
Re: PHP LDAP module does not seem to be present
Group DevelopersGroup Documentation writersGroup Particularly helpful Moodlers
I'd like to know a couple of things:

1.- What is the exact error message you get (I don't know what a confermation error is wink

2.- Which exact version of Moodle you are using (paste the contents of .../moodle/version.php here).

Saludos. Iñaki.
 
Average of ratings: -
Picture of Ian Scott
Re: PHP LDAP module does not seem to be present
 

I've setup a new install - did everything correctly - I know I did!! LDAP not present in PHP. Rechecked - same! In decided I'd try one last thing (this is a Windows 2003 IIS install) - instead of the location of the system variable at the end of the list (for the PHP folder) I put it at the begining (naturally a reboot) - worked! I hate windows at times.

PS added this try and stop the frustion of fellow windows 2003 installers

 
Average of ratings: -
Picture of Anatol Bogun
Re: PHP LDAP module does not seem to be present
 
One more hint that might help someone: Make sure that there are no other older or broken libeay32.dll or ssleay32.dll files around. Always use the files that come with the binary download of your PHP version.

I tried endless combinations of copying .dll files to directories, setting up Windows PATH variables, changing the php.ini, I tried every hint I could find in thousands of forum threads, but I would always get this message in the php error log:

"PHP Warning: PHP Startup: Unable to load dynamic library '<PATH>php_ldap.dll' - The operating system cannot run %1. in Unknown on line 0"

Now what I was not aware of was that there were older versions of libeay32.dll and ssleay32.dll in the Apache binary directory (bin). These were probably loaded first and that messed everything up.

So if you have trouble it is probably worth checking your server for other libeay32.dll and ssleay32.dll . Maybe even another older php_ldap.dll somewhere else might cause the problem.

I hope this could save someone some time and frustration.

Good luck!
 
Average of ratings: -
Picture of Robert Saari
Re: PHP LDAP module does not seem to be present
 

This is an old thread, but someone may find this useful:

If you're running Moodle on a Windows box, change the extension_dir line in php.ini from

extension_dir = "./extensions"

to

extension_dir = ".\extensions"; "C:\php\extensions"

Then restart IIS.

This solved my problem.

 
Average of ratings: -
Me in Afghanistan
Re: PHP LDAP module does not seem to be present
 

Folks I had the missing PHP  Ldap.  extention issue as well.  I am using Xampp.  I fixed this by simply uncommenting the php.ini file line item ldap.dll in the apache.bin.  Restarted Apache...and it worked.

-Michael

 
Average of ratings: -
Weeping Woman
Re: PHP LDAP module does not seem to be present
 
I've installed 1.9 on Windows Server 2003 running Apache2Triad, and still have the problem at the beginning of the thread. Any help would be greatly appreciated.
 
Average of ratings: -
Picture of Iñaki Arenaza
Re: PHP LDAP module does not seem to be present
Group DevelopersGroup Documentation writersGroup Particularly helpful Moodlers
Have you tried any of the proposed solutions given in this same thread? If so, what results did you get?

Saludos. Iñaki.
 
Average of ratings: -
Weeping Woman
Re: PHP LDAP module does not seem to be present
 
I tried the solution proposed in the reply above mine, but couldn't locate the files on the server. Several of the other solutions are for IIS and I don't know if they apply to a server running Apache.
 
Average of ratings: -
Weeping Woman
Re: PHP LDAP module does not seem to be present
 
This is what eventually cracked it for me, from the post by Scott Hardwick, above -

"Configuration File (php.ini) Path C:\moodle\apache\bin\php.ini

Open and edit that file and remove the semicolon (;) in front of the line :
extension=php_ldap.dll"

However, my php.ini file was actually situated in C:\Windows\ which I found out by visiting the Server>PHP Info section of the Site Administration Menu, where I located it in the top PHP information table to the right.

And so far that seems to be it.

Thanks,

Zbysiu



 
Average of ratings: -
Picture of Tim Beachy
Re: PHP LDAP module does not seem to be present
 

I know this is a really old thread...but I'm now on a new Moodle 2.0 installation using PHP5.3.5 on a hosted shared server environment, and am still getting this error.  I have LDAP enabled on the auth screen, but cannot see the settings as this error comes up.

It seems no one else on this thread uses shared hosting but it would appear from phpinfo.php that ldap is configured on my server:

'--with-ldap=shared'  (under the "Configure Command" section)

I've added "extension = php_ldap.dll" to my phprc (phpinfo) file, but it did not help.

Can anyone think of anything to help me with this?  Is the shared host the problem somehow?

Thanks for any help.

 
Average of ratings: -
Rosario playing soccer
Re: PHP LDAP module does not seem to be present
Group Particularly helpful Moodlers

Very strange, I just installed a 2.03 Server and have nothing except eMail-selfregistration and manual. But I need LDAP and Shibboleth as I have on my production server 1.9.x

Rosario

 
Average of ratings: -
Rosario playing soccer
Re: PHP LDAP module does not seem to be present
Group Particularly helpful Moodlers

I found the reason: it was the memory limit in php5.ini that caused my problem. See here:

http://moodle.org/mod/forum/discuss.php?d=174277

Rosario

 
Average of ratings: -
Picture of Iacopo Sorce
Re: PHP LDAP module does not seem to be present
 

I know it's quite an old thread, but I stumbled upon the same problem recently. I found some hints here, but I wanted to point out my experience.

First off, I run moodle 2.0.3 on IIS 6. I installed PHP 5.3.6 with default settings and this caused my problem. In fact, even if I added the php_ldap.dll and edit the php.ini file, the LDAP module kept not being loaded.

I had to re-run the PHP 5.3.6 installer and change the installation, adding the support to LDAP (Extensions/LDAP). After that, all went fine.

I hope this can save someone's time ;)

 
Average of ratings:Useful (2)
Picture of Shreyas Kharat
Re: PHP LDAP module does not seem to be present
 

I did do the changes given by you on my server. The file php.ini(in production) is also uncommented on the line ;extension=php_ldap.dll to extension=php_ldap.dll but still it says to me PHP LDAP module does not seem to be present. Please can give me some hint on this error.

I am using Moodle version 2.1.2+ stable

With regards,

Shreyas Kharat

 

 
Average of ratings: -
Picture of Rick Ruby
Re: PHP LDAP module does not seem to be present
 

You may also go to Control Panel in Windows Server 2008 R2, then Programs and Features, Click on the version of PHP you have installed, then click change. When the next window opens click IIS FastCGI, then in the window, "Choose Items to Install", click on extensions, and click on LDAP (which should have a red 'X' through it), click next, finish install and ldap should be installed.

 
Average of ratings: -
Picture of Craig Gray
Re: PHP LDAP module does not seem to be present
 

Folks this has been a very helpful discussion, and I am hoping someone can help me with a similar LDAP problem.

I followed the various suggestions on this page and a previous instance of Moodle 1.9 on Windows 2003 (same server) had ldap working just fine.

I have the setup page for ldap, and php -m shows it is installed. All 3 dll's listed are in Windows\System 32 file, and the path shows as C:\Windows

When I put the settings in and attempt to authenticate I get an

error message in red stating

A required parameter (auth) was missing

The more information about this error points me to a generic moodle page with little info on it.

Key to understanding this is a previous install of 1.9 on this server was working just fine.  and the same settings are working on a production server albeit in Ubuntu Os.

 

Any help you can provide would be greatly appreciated.

 

 
Average of ratings: -
Picture of Craig Gray
Re: PHP LDAP module does not seem to be present
 

This is what is set in our system

ldap
LDAP Support enabled
RCS Version $Id$
Total Links 0/unlimited
API Version 3001
Vendor Name OpenLDAP
Vendor Version 20319
SASL Support Enabled

 
Average of ratings: -
Picture of Craig Gray
Re: PHP LDAP module does not seem to be present
 

The failure seems to be in the auth_config.php file, at least that is where it stops.  

 
Average of ratings: -