Forum LAMS for Tech-Heads - General Forum: LAMS-Moodle integration problem


 
You may request notification for LAMS-Moodle integration problem.
Search: 

1: LAMS-Moodle integration problem
05/13/06 08:17 AM
[ Reply | Forward ]
I got the following error on the moodle-side when I attempted to install a LAMS-moodle integration:

japanese-translator-patent/mod/lams/lib.php on line 4

Warning: main(../../config.php): failed to open stream: No such file or directory in /home/horsefro/public_html/japanese-translator-patent/mod/lams/lib.php on line 4

Warning: main(): Failed opening '../../config.php' for inclusion (include_path='.:/usr/lib/php:/usr/local/lib/php') in /home/horsefro/public_html/japanese-translator-patent/mod/lams/lib.php on line 4

The line referred to was the following:

include_once("../../config.php");

Any idea how I can fix this?

Cheers in advance,

Best regards,

James Phillips

Posted by James Phillips

2: Re: LAMS-Moodle integration problem
In response to 1 05/15/06 05:48 PM
[ Reply | Forward ]
Hi James,

You might have a similar problem to the one in this thread. Try editing the mod/lams/lib.php and replacing the line on line 4 that reads '../../config.php' with the full path to your moodle config.php, for instance '/home/horsefro/public_html/japanese-translator-patent/config.php' (make sure it points to the real file).

Cheers,

Posted by Jun-Dir Liew

3: Re: Re: LAMS-Moodle integration problem
In response to 2 05/17/06 10:12 PM
[ Reply | Forward ]
Thanks for that! That fixed that particular problem. I now have two more though! I have looked through the other threads and there were a couple of similar-looking problems but none of the fixes seemed to work in my case. I have a high-volume VPS (2GB of RAM) where I have installed LAMS, which is working fine by itself. I then have two sites installed on different domains also hosted on the same VPS, one of which is a production site running Moodle 1.5.3, and the other of which is a test site running Moodle. 1.6. With the site running 1.5.3 I get the following error when I try to add a LAMS sequence:

An unexpected error returned from LAMS server:soapenv:Server.userException: java.rmi.RemoteException: Fail to fetch user data from external server:lamsserver01 - Unexpected return HTTP Status; nested exception is: java.lang.Exception: Fail to fetch user data from external server:lamsserver01 - Unexpected return HTTP Status! Please contact your administrator.

I understand that this is something to do with creating users on the fly, but wasn't quite able to understand the solution as described in another thread.

Also, on the 1.6 site, I get the error as shown in the file attached.

Posted by James Phillips

Attachments:
4: Re: LAMS-Moodle integration problem
In response to 1 05/17/06 10:50 PM
[ Reply | Forward ]
For the error in the Moodle 1.5.3 server, try checking your callback_url in the LAMS database first. It should look like this (replace 'localhost' with your Moodle's domain name or IP):

http://localhost/moodle/mod/lams/userinfo.php?un=%username%&ts=%timestamp%&hs=%hash%

For the 1.6 server, is the serverid and prefix unique? i.e., if both Moodle servers share the one LAMS server, then the serverid and prefix must be unique otherwise communication could get mixed up between them.

Posted by Jun-Dir Liew

5: Re: Re: LAMS-Moodle integration problem
In response to 4 05/22/06 03:10 AM
[ Reply | Forward ]
I checked both of these items and there didn't seem to be any problem. I have pretty much come to a dead end here and would appreciate any further suggestions.

Posted by James Phillips

6: Re: Re: Re: LAMS-Moodle integration problem
In response to 5 05/22/06 03:37 AM
[ Reply | Forward ]
I have also just realized that my LAMS sequences are not appearing in the left hand menu after I create them if I access LAMS directly and create sequences in LAMS. Is this a PHP version problem? I am using the following:

PHP Version 4.3.11
Mysql Version 4.1.18
Operating System Linux
Apache Version 1.3.34 (Unix)
Perl Version 5.8.7

Posted by James Phillips

7: Re: LAMS-Moodle integration problem
In response to 1 05/22/06 07:38 PM
[ Reply | Forward ]
Can you attach (or email, if you'd prefer) some access logs from LAMS and Apache? From LAMS:
/path/to/jboss/server/default/log/localhost_access2006-05-23.log
(please attach the log for the date you had the error - or you could go through the process again, and just reattach today's log).

From Apache:
/path/to/htdocs/logs/access.log
(your access log file name might vary).

Also, note that Moodle 1.6 already has the lams module present, so you don't need to install the files. In moodle/mod/lams/lib.php, at the top where it includes a line like,
require_once($CFG->dirroot.'/lib/soap/nusoap.php');
make sure it points to a file that exists. In Moodle 1.6, I think it should look like the above. In 1.5, it looks like,
require_once($CFG->dirroot.'/lib/nusoap/nusoap.php');

Once we can see the access logs, we'll see what it's doing and take it from there.

Cheers,

Posted by Jun-Dir Liew

8: Re: Re: LAMS-Moodle integration problem
In response to 7 05/22/06 07:57 PM
[ Reply | Forward ]
OK. Thanks! Is this purely connected to the integration? The LAMS sequences I am making are not appearing in the left menu also and so cannot be selected and I was also wondering how I should go about getting that to work? Sorry for having so many questions.

Posted by James Phillips

9: Re: LAMS-Moodle integration problem
In response to 1 05/22/06 08:01 PM
[ Reply | Forward ]
Sorry, didn't see your second to last post! I'm a bit confused which left hand panel you're referring to - is this in Monitor? Could you post a screenshot?

My last post was purely about the integration, yes.

Posted by Jun-Dir Liew

10: Re: Re: LAMS-Moodle integration problem
In response to 9 05/22/06 08:17 PM
[ Reply | Forward ]
Thanks again!
If I create a sequence in "author" then switch to "Learner" the sequence does not appear in the "available sequences" list.

Posted by James Phillips

Attachments:
11: Re: LAMS-Moodle integration problem
In response to 1 05/22/06 08:23 PM
[ Reply | Forward ]
Did you remember to create a session in Monitor for that sequence? You have to create a session and assign a class to it, before it appears in the Learner's view.

Cheers,

Posted by Jun-Dir Liew

12: Re: Re: LAMS-Moodle integration problem
In response to 11 05/22/06 11:04 PM
[ Reply | Forward ]
Thanks! You are correct. I wasn't using it properly. Please find the LAMS logs attached. I am still trying to dig the apache logs out.

Posted by James Phillips

Attachments:
13: Re: LAMS-Moodle integration problem
In response to 1 05/22/06 11:26 PM
[ Reply | Forward ]
Cheers for that, can you also post the contents of your ext_server_org_map table? Login to mysql, and at the mysql prompt do

use lams;
select * from ext_server_org_map;

where 'lams' is the name of your LAMS database.

I just noticed I posted an incorrect path to Apache's access log, the log directory shouldn't be under htdocs, it is at the same level. So if you installed Apache under one directory, e.g. /usr/local/apache/logs/access.log
Or, some distros may put the log directory under somewhere like /etc/httpd/logs or something.

Posted by Jun-Dir Liew

14: Re: Re: LAMS-Moodle integration problem
In response to 13 05/22/06 11:40 PM
[ Reply | Forward ]
-- Dumping data for table `ext_server_org_map`
--

INSERT INTO `ext_server_org_map` VALUES (1, 'lamsserver01', 'XXXXXXXXX', 'horse', 'test server for horsefrog', 'H', 'http://www.horsefrog.com/japanese-translator-patent/mod/lams/userinfo.php?un=%username%&ts=%timestamp%&hs=%hash%', '', 0, 1001);
INSERT INTO `ext_server_org_map` VALUES (2, 'lamsserver02', 'XXXXXXXX', 'testing', 'testing server', 'T', 'http://www.hatsuon.jp/testing/moodle/mod/lams/userinfo.php?un=%username%&ts=%timestamp%&hs=%hash%', '', 0, 1000);


I XXXXed out the passwords.

Posted by James Phillips

15: Re: Re: Re: LAMS-Moodle integration problem
In response to 14 05/23/06 12:15 AM
[ Reply | Forward ]
The Apache access log is attached.

Posted by James Phillips

Attachments:
16: Re: LAMS-Moodle integration problem
In response to 1 05/23/06 03:53 AM
[ Reply | Forward ]
In your ext_server_org_map, you have orgid's of '1001' and '1000' - when you create organisations, the id's usually start from 1020. If the organisation with id=1001 doesn't exist then it won't work. Can you let me know how you got these numbers, and if they exist in the mysql table 'u_organisation'? See the instructions on how to check the u_organisation details.

The apache log you posted isn't the right one for either of the two moodle servers - there's no record of accesses to /japanese-translator-patent or /testing/moodle URLs. What we should see in the access log is a line such as:

11.11.11.11 - - [06/Sep/2005:17:32:12 +1000] "GET /moodle/mod/lams/userinfo.php?un=admin&ts=1125991932162&hs=b85a9dbf2a
79468afcd86008b7c5e43c0c5702bb HTTP/1.1" 200 53

This is evidence of LAMS successfully calling Moodle for details of the user 'admin'.

Posted by Jun-Dir Liew

17: Re: Re: LAMS-Moodle integration problem
In response to 16 05/23/06 05:24 AM
[ Reply | Forward ]
Ah, I see. I had made a mistake there. The generated id for my ogrganization (horsefrog) was 1030 so I have changed the org id's in ext_server_org_map to 1030. The faults are still the same though, which is a little puzzling. Am searching through the logs at the moment.

Posted by James Phillips

18: Re: LAMS-Moodle integration problem
In response to 1 05/23/06 05:55 PM
[ Reply | Forward ]
Another thing that might be worth checking is, whether you can access www.horsefrog.com from the LAMS server, as LAMS needs to access this server for the integration to work. I can't think why it might be blocked, but worth checking IMHO just in case.

Also, if you do post your Apache access log, don't feel that you have to post the whole thing - they can get pretty big, but we're only interested in the accesses from the time you test the integration. And then there's a privacy issue, I feel a bit voyeuristic looking at someone's full access log!

Posted by Jun-Dir Liew

19: Re: Re: LAMS-Moodle integration problem
In response to 18 05/26/06 07:59 AM
[ Reply | Forward ]
The problem is driving me absolutely crazy and I don't seem to be making any progress with it at all. I have stopped looking at the 1.53 errors just to simplify things a bit and am now concentrating on the 1.6 installation. The following error is being returned from the LAMS server:
"http://www.keypot.com:8080/lams/LoginRequest?uid=admin&method=author&ts=May+24%2C2006+8%3A35+pm&sid=lamsserver01&hash=9f0e4fe041d3e84a14dedc07f6c6cef824d7f42d&course_id=3"
I must have checked the content of the database 100 times now and there doesn't seem to be anything amiss. There obviously is, but unfortunately my untrained eye cannot spot it.

Posted by James Phillips

Reply to first post on this page
Back to LAMS for Tech-Heads - General Forum