Undefined index: dirroot; 8.04 lamp can't/won't create .htaccess

Undefined index: dirroot; 8.04 lamp can't/won't create .htaccess

by Ralph Patterson -
Number of replies: 7
8.04 lamp can't create .htaccess

I'm using 8.04 edubuntu desktop with LAMP installed for running Moodle 1.9, Webmin verifies Apache2 and MySQL are running. I can pull directory listings from my www folder, but believe I need to create a .htaccess file. I am unable to create the file or rename a file with the settings I need to ".htaccess", it simply doesn't like the "."

The error I am getting is:

Notice: Undefined index: dirroot in /var/www/moodle/install.php on line 136

Notice: Undefined index: dirroot in /var/www/moodle/install.php on line 137

Notice: Undefined index: admindirname in /var/www/moodle/install.php on line 139

Warning: require_once(/lib/adminlib.php) [function.require-once]: failed to open stream: No such file or directory in /var/www/moodle/install.php on line 148

Fatal error: require_once() [function.require]: Failed opening required '/lib/adminlib.php' (include_path='.:/usr/share/php:/usr/share/pear') in /var/www/moodle/install.php on line 148

Additionally I've tried:
  • chmod 777 on the "lib" directory
  • using the instructions in the docs directory to:
    • add AcceptPathInfo on to the httpd.conf file
    • verify the php.ini were set to:
safe_mode = 0 (necessary)
memory_limit = 40M (varies: minimum 16M, 32M Moodle v1.7, 40M Moodle v1.8, 128M large sites)
session.save_handler = files (unless you are using another handler, e.g. mm)
magic_quotes_gpc = 1 (preferred but not necessary, 0 will be recommended in 2.0)
magic_quotes_runtime = 0 (necessary)
file_uploads = 1
session.auto_start = 0
session.bug_compat_warn = 0
(* I only had to set the bug compat warn - all other settings were correct *)

with the same error occurring.

Thanks in advance,

Ralph
Average of ratings: -
In reply to Ralph Patterson

Re: Undefined index: dirroot; 8.04 lamp can't/won't create .htaccess

by jack benson -
no one can solve this problem?!!!!!!!!!!!
In reply to jack benson

Re: Undefined index: dirroot; 8.04 lamp can't/won't create .htaccess

by Gordon Bateson -
Picture of Core developers Picture of Peer reviewers Picture of Plugin developers
Hi Jack,
I don't think you need ".htaccess". I think you can forget about that for a while. If Moodle needs it, for example in the course data folder, it will create it for you.

Have you created a MySQL database and MySQL user that Moodle can use? Thats's the first step.

Once you have done that, then you should be able to run the Moodle installer and it will ask you for certain paths, the MySQL database access details and then set everything up for you.

If you continue to have problems, please let us know how far along the installation path you have got.

all the best
Gordon
In reply to Gordon Bateson

Re: Undefined index: dirroot; 8.04 lamp can't/won't create .htaccess

by Gordon Bateson -
Picture of Core developers Picture of Peer reviewers Picture of Plugin developers
Aha - I realize now my response should have been addressed to Ralph.
sorry about that
Gordon
In reply to Gordon Bateson

Re: Undefined index: dirroot; 8.04 lamp can't/won't create .htaccess

by Bosco BOUKONE -
Hi,

I have same problem too when installing moodle 1.9.3 on debian lenny:
mine it's look like that:

Notice: Undefined index: dirroot in /var/www/moodle/install.php on line 136

Notice: Undefined index: dirroot in /var/www/moodle/install.php on line 137

Notice: Undefined index: dataroot in /var/www/moodle/install.php on line 138

Notice: Undefined index: admindirname in /var/www/moodle/install.php on line 139

Notice: Undefined index: wwwrootform in /var/www/moodle/install.php on line 143

Warning: require_once(/lib/adminlib.php) [function.require-once]: failed to open stream: No such file or directory in /var/www/moodle/install.php on line 148

Fatal error: require_once() [function.require]: Failed opening required '/lib/adminlib.php' (include_path='.:/usr/share/php:/usr/share/pear') in /var/www/moodle/install.php on line 148

Anyone have an idea?

Thanks in advance

Bosco B


In reply to Bosco BOUKONE

Re: Undefined index: dirroot; 8.04 lamp can't/won't create .htaccess

by Richard Enison -
BB,

OK. First of all, the notices (about undefined indexes) are just that: notices, not errors. You can ignore them.

The warning, on the other hand, explains the fatal error: it occurred because a required file was not found. The file it was looking for was adminlib.php, which it should have found in /var/www/moodle/lib. Can you check (using File Manager, FTP, shell access, etc.) to see if it does exist? If it doesn't, it means part of Moodle is missing. At least one file (and probably more) didn't make it. Either the extraction of files was interrupted, or the download was incomplete. Try it again.

RLE
In reply to Richard Enison

Re: Undefined index: dirroot; 8.04 lamp can't/won't create .htaccess

by Elvedin Trnjanin -
This issue is caused by PHP trying to write session data to a directory the web server does not own. Edit your php.ini and look for the session.save_path

Setting it to something like

session.save_path = "/tmp"

shoudl work as Apache and all other users typically have access to write to /tmp
In reply to Bosco BOUKONE

Re: Undefined index: dirroot; 8.04 lamp can't/won't create .htaccess

by Brian Carpenter -
You must set the docroot's owner and group to whatever apache is running as.
Ubuntu's default user is "www-data"

so something like this should work.

chown -R www-data:www-data /var/www/moodle