Config.php in "moodle" directory?

Config.php in "moodle" directory?

by Roberto Catanuto -
Number of replies: 7

Moodle 3.3.2

Hi, I'm trying to upgrade from 3.3.2 to 3.5, following this guide https://subscription.packtpub.com/book/hardware_and_creative/9781783289714/1/ch01lvl1sec13/updating-moodle

I've backed up the database and the folder "moodledata". I've downloaded moodle35. Now the guide says to copy the old config.php to the new moodle folder. The old config.php should be in the old moodle directory while it isn't. I can only find a config-dist.php.

The config.php is in "/subdomains/<mydomain>/httpdocs" while the guide says it should be in "/private/moodle". Where am I wrong?

Thank you very much.

Average of ratings: -
In reply to Roberto Catanuto

Re: Config.php in "moodle" directory?

by Leon Stringer -
Picture of Core developers Picture of Particularly helpful Moodlers

If you have a working Moodle site there must be a config.php in the Moodle source code folder which is the folder the web server is configured to use for your Moodle site, it gets created as part of the Moodle install process.

"/subdomains/<mydomain>/httpdocs" sounds like the right sort of location, the location varies for various server configurations.

You can definitively locate this by logging into Moodle as a site admin and going to the Site administration → Server → PHP info report. Search for "_SERVER['SCRIPT_FILENAME']" which should be "/PATH/TO/MOODLE/admin/phpinfo.php". The part before "/admin/phpinfo.php" is the folder containing config.php. E.g. on my system this is:

$_SERVER['SCRIPT_FILENAME']: /var/www/role38.leon/moodle/admin/phpinfo.php

so config.php is in /var/www/role38.leon/moodle.

Average of ratings: Useful (1)
In reply to Leon Stringer

Re: Config.php in "moodle" directory?

by Roberto Catanuto -
Thank you Leon (and all the others) for replying. I have found the "config.php" in the folder /subdomains/my_domain/httpdocs.

I still wonder why this guide:
https://subscription.packtpub.com/book/hardware_and_creative/9781783289714/1/ch01lvl1sec13/updating-moodle
says I should find "config.php" in /private/moodle while there is not?

Thanks.
In reply to Roberto Catanuto

Re: Config.php in "moodle" directory?

by Visvanath Ratnaweera -
Picture of Particularly helpful Moodlers Picture of Translators
I guess, you have to ask the author https://subscription.packtpub.com/book/hardware_and_creative/9781783289714.

If there is something with https://docs.moodle.org/35/en/Upgrading, you can ask here.
Average of ratings: Useful (1)
In reply to Visvanath Ratnaweera

Re: Config.php in "moodle" directory?

by Roberto Catanuto -
Thank you. I've now followed the official document https://docs.moodle.org/35/en/Upgrading.

More specifically, these points are fine:
[ok] mv moodle moodle.backup
[ok] tar xvzf moodle-3.5.tgz

Now the problem is this command from the official guide:
cp moodle.backup/config.php moodle
because I have no "config.php" in "moodle.backup/" but that file is in "/subdomains/my_domain/httpdocs".

I could try to:
1. simply substitute moodle.backup/ with the new moodle/ version directory, and then restart moodle.
If having "config.php" in "/subdomains/my_domain/httpdocs" worked for the old version, I think it could work for the new one as well?

2. copy the "config.php" from "/subdomains/my_domain/httpdocs" to the new moodle/ directory and then restart moodle

Any suggestion is welcome.
Have a nice day.
In reply to Roberto Catanuto

Re: Config.php in "moodle" directory?

by Visvanath Ratnaweera -
Picture of Particularly helpful Moodlers Picture of Translators
There is a confusion somewhere. You have (had) a running Moodle installation. In that server you find a directory 'moodle' with no config.php. But there is a config.php in a the directory 'httpdocs'? I tend to say that 'httpdocs' directory _is_ the "moodle" directory. This time "moodle" is meant as a name, a reference to the directory where the Moodle code is.

To check its correctness, create a file test.html with some simple HTML (or even text) in the httpdocs directory and visit http://example.com/test.html in you browser - replace http://example.com with the URL of your Moodle site. If the browser shows you the content of your test.html, then 'httpdocs' is you "moodle" directory!
Average of ratings: Useful (1)
In reply to Roberto Catanuto

Re: Config.php in "moodle" directory?

by Ken Task -
Picture of Particularly helpful Moodlers

In addition to Leon's response, suggest looking at the official moodle upgrades page:

https://docs.moodle.org/39/en/Upgrading

Regardless of what doc you reference, more than likely you will still have to translate what it says to your system and how it is set up ... especially any reference in any doc concerning location.

2 cent addition ... ;)

'SoS', Ken


In reply to Ken Task

Re: Config.php in "moodle" directory?

by Rick Jerz -
Picture of Particularly helpful Moodlers Picture of Testers
You can also see https://moodle.org/mod/forum/discuss.php?d=401983#p1621924 for my videos, but as Ken said, you will have to translate these to your own system. My videos provide a general method, but may not apply to exactly what you are trying to do, and different versions of moodle are involved. Since both 3.3 and 3.5 are a bit old, I cannot remember if there were any issues.
Average of ratings: Useful (1)