Fatal Error when logging in

Fatal Error when logging in

by Jon Fernquest -
Number of replies: 5

I was browsing in the admin section of Moodle looking for user authentication options yesterday and today when I tried to login I got the following fatal error message:


Fatal error: Call to undefined function: ldap_connect() in /home/bangk4/public_html/moodle/enrol/ldap/enrol.php on line 437

I don't believe I changed anything, but apparently I did.

Is there anyway I can set things back to normal without logging in, so that I can log in?

Thanks in advance for any help you can give,

Jon Fernquest

The Bangkok Post

Average of ratings: -
In reply to Jon Fernquest

Re: Fatal Error when logging in

by Iñaki Arenaza -
Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers
It seems your PHP installation is missing the LDAP module, and that your site is configured to use LDAP enrolment. Make sure the PHP LDAP module is installed and activated.

Saludos. Iñaki.
In reply to Iñaki Arenaza

Re: Fatal Error when logging in

by chris dennison -

Iñaki, I've been trying for days to get my moodle site running on Debian Linux.  All seems OK except no-one can log in with LDAP authorisation.  The function call to 'ldap_connect()' is undefined.  It all works on my windows 2003 server. ( www.henrycort.org )  [Site not yet launchedblush]

I have Debian 3.1, PHP 5.2.1 (DotDeb) and MySQL 5.0.32 (DotDeb)  Moodle is a fresh install of 1.7.1+.

I've ported moodledata and restored the database - all seems OK for those users created manually.

phpinfo shows Modules Loaded :-

core mod_access mod_auth mod_log_config mod_logio mod_env mod_setenvif prefork http_core mod_mime mod_status mod_autoindex mod_negotiation mod_dir mod_alias mod_so util_ldap mod_auth_ldap mod_cgi mod_php5 mod_userdir

But no block for LDAP - before libxml.

Can you tell me what I must do to 'activate' ldap?

Many thanks, Chris

In reply to chris dennison

Re: Fatal Error when logging in

by Iñaki Arenaza -
Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers

Hi Chris,

these modules are the Apache modules, not the PHP ones smile

You need to install and enable the PHP LPAP module. As you are not using the standar PHP package, you'll need to make sure you have downloaded the PHP LDAP module as part of your PHP installation (most probably) and edit your php.ini file to make sure the extension is loaded and enabled properly.

Usually you just need to add a line like this to your php.ini file:

extension=ldap.so

and then restart Apache in order to reload PHP with the new configuration and extensions.

Saludos. Iñaki.

In reply to Iñaki Arenaza

Re: Fatal Error when logging in

by chris dennison -
Thanks Iñaki, that was the problem smile. It all arose when I tried to port Moodle to Linux (as a complete novice - lol) from Windows 2003. I did get a system up and running with the Debian standard packages, but Moodle 1.7.1 complained that it needed a later revision - exactly of what I can't remember - and googling came up with a recommendation for a Debian LAMP setup via dot.deb.org which is what I have used.

Thanks again