An installation problem

An installation problem

by Mark Karnowski -
Number of replies: 9

I'm having a poblem with installing this product.  Perhaps someone could help me.  My website hosting account is on a Unix machine with Apache/Perl/PHP(required version)/MySQL.

I'm only getting blank screens when I attempt to connect, and I suspect that it may be because some of the path info in my config.php may be wrong.

The hosting service lists paths to my folders this way:

/home/*username*/*mydomain.com*/public_html, for instance.  This must not be the format to use in the config file.  Is there some simple answer to what the complete path probably is on my server, or is this something I need to try to get from of the hosting service?

I appreciate any help or tips you can give me.  Obviously I'm a beginner.

Mark

 

 

Average of ratings: -
In reply to Mark Karnowski

Re: An installation problem

by Martin Dougiamas -
Picture of Core developers Picture of Documentation writers Picture of Moodle HQ Picture of Particularly helpful Moodlers Picture of Plugin developers Picture of Testers
Sounds like you've done the right thing, but to be sure, try putting this line in your config.php somewhere, and see what it prints out:

echo dirname(__FILE__);
In reply to Mark Karnowski

Re: An installation problem

by Howard Miller -
Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers

The path you give sounds reasonable, if a bit lengthy. But lets just make sure …

You will have to upload moodle underneath public_html (most probably), although it does depend on exactly how they have set Apache up. So if you create a directory called moodle under that directory the path will be:

/home/myname/mydomain.com/public_html/moodle

..and that is what you should put in config.php.

I take it you have concluded where to put the data files? You probably need to set up something like

/home/myname/mydomain.com/moodledata

but make sure that you make it writeable by the Apache process (probably need to be writeable by everyone), so the dreaded chmod 777 is a possibility.

Oh … another thought!! Are you certain that index.php is set up as a DirectoryIndex? Have you tried typing …

http:// … whatever … /moodle/index.php

..just to make sure.

In reply to Howard Miller

Re: An installation problem

by Timothy Takemoto -

I don't seem to be able to specify my root directory either. I am pretty sure
that I am specifying the right thing.

My base directory is specified using /home/username/

I have successfully used this base directory path when installing "quiztest"
( incidentally, of http://www.tesol.net/scripts/ ), a blog and a php forum.

I have uploaded moodle to a directory in my public_html folder.
When I use the ftp command "pwd" in the moodle folder I get
/public_html/moodle (no surprises). So I set dirroot as
dirroot = '/home/nihonbun/public_html/moodle'

I have also used Martin' suggestiong above and included echo dirname(__FILE__);



The resultant output  is:

/home/username/public_html/moodle                     

Error detected in config.php

Error in: $CFG->dirroot = '/home/username/public_html/moodle';

Try this: $CFG->dirroot = '/home/username/public_html/moodle';

Which looks like it is telling me that the directory really is as I set it,
but that an error is still arising.

Perhaps errors elsewhere in my set up cause their to be an error to be reported
in the above line.

I am pretty sure that the data directory, in my base directory, outside
of public_html, is set okay to
/home/username/moodledata
It is chmodded to 777 at the moment.

I am using last night's dump of Moodle on Linux with PHP 4.3.1 and MySQL 4.0.12.

I have set a .htaccess file as described in the installation instructions (since I do not
have access to htpconfig ). I index.php is set to be one of the default index files as
well as index.htm and index.html.

I have tried moving the Moodle directory (At first I had it in a sub sub directory)
/home/username/public_html/directoryname/moodle'
(Which is where I would really like to put it).

I have also tried entering
http://mydomain.com/moodle/index.php
As suggested above. This takes me to config.php and the same output as above.

Could this be a bug with 1.09 - along the lines of what Soren reports here
http://moodle.org/mod/forum/discuss.php?d=1316
or am I doing something stupid?

 

In reply to Timothy Takemoto

Re: An installation problem

by Martin Dougiamas -
Picture of Core developers Picture of Documentation writers Picture of Moodle HQ Picture of Particularly helpful Moodlers Picture of Plugin developers Picture of Testers
It looks like you've done everything right.

There's a very new thing that I put in config-dist.php yesterday to try and catch certain types of configuration errors.

Unfortunately it doesn't seem to work on your server like it did on my test servers.  :-(

Please just edit your config.php, look down near the bottom and remove these lines:

if (! @include_once("$CFG->dirroot/lib/setup.php"))  {    // Do not change this
    echo "<p>Error detected in config.php</p>";
    echo "<p>Error in: \$CFG->dirroot = '$CFG->dirroot';</p>";
    echo "<p>Try this: \$CFG->dirroot = '".dirname(__FILE__)."';";
    die;
}

and replace them with this:

include("$CFG->dirroot/lib/setup.php");

Cheers,
Martin
In reply to Martin Dougiamas

Re: An installation problem

by Timothy Takemoto -

I tried the change above and found no difference.

Then I realised that I had uploaded only half of the
moogle installation!
shy.gif
My ftp software (FFFTP, a Japanese brand) may have some
sort of time out as if to say, "you have uploaded enough already.
Cut connection." Or it may have been because I attempted another
operation (show newest information) during the upload.

Now that I have uploaded the other half I get past this problem
(to another problem which I am researching).

If there is anything worthwhile to note from my stupidity it is perhaps
that errors reported on the dirroot definintion line do not necessarily
mean that there is an error with the definition, but an error elsewhere.

Tim

In reply to Martin Dougiamas

Re: An installation problem

by Antti Immonen -
Please fix your settings in config.php:

You have:

$CFG->dirroot = "/home/users/wkasv03/public_html/moodle";

but it should be:

$CFG->dirroot = "";

Continue

This kind of box appears and i dont understand it and it doesnt allow me to continue upgrade process. I add part of my config to attachment. NOTE: i have tried with original config. Php= 4.1.2 and M1.8 worked out just fine.

???

 

In reply to Antti Immonen

Re: An installation problem

by Martin Dougiamas -
Picture of Core developers Picture of Documentation writers Picture of Moodle HQ Picture of Particularly helpful Moodlers Picture of Plugin developers Picture of Testers
Arg, yuk.  Obviously PHP is crippled in some way on that server, so the check is failing.

OK.

Please edit admin/index.php and just completely remove these lines:

/// Check settings in config.php

    $dirroot = dirname(realpath("../config.php"));
    if ($dirroot != $CFG->dirroot) {
        error("Please fix your settings in config.php:
              <P>You have:
              <P>\$CFG->dirroot = \"".addslashes($CFG->dirroot)."\";
              <P>but it should be:
              <P>\$CFG->dirroot = \"".addslashes($dirroot)."\";",
              "./");
    }
In reply to Martin Dougiamas

Re: An installation problem

by Antti Immonen -

That solved the problem, thanks. And thank you for your amazing fast support smiley.gif.

( But before the moodle109 was running, i have get back my dp dump and reinstall moodle109, because i assumed that "courses trasfer to next version". Obviously they dont  surprise.gif. .. )

 

In reply to Antti Immonen

Re: An installation problem

by Martin Dougiamas -
Picture of Core developers Picture of Documentation writers Picture of Moodle HQ Picture of Particularly helpful Moodlers Picture of Plugin developers Picture of Testers
surprise Yes, everything transfers! When you upgrade you continue to use the same database, and that database is upgraded to use the new features, so NO DATA IS LOST, and no features are lost.

Making a backup of the database is purely a precaution, just in case you need to go back to the old version for some reason.