Does anyone have a clean copy of the config.php

Does anyone have a clean copy of the config.php

by Gary Johnson -
Number of replies: 22
I am trying to install but having a hard time reading the config.php to find where to put things into it. There are so many slash marks.
Average of ratings: -
In reply to Gary Johnson

Re: Does anyone have a clean copy of the config.php

by Scott Tomassetti -
Download a clean copy of moodle from moodle.org and the config file is in there.
In reply to Scott Tomassetti

Re: Does anyone have a clean copy of the config.php

by Gary Johnson -
I have tried that. the problem for me is I am having a hard time finding what I need to change through a the slash marks and other things that are in there...
In reply to Gary Johnson

Re: Does anyone have a clean copy of the config.php

by Alvin Shaffer -

What program are you using to view the config-dist.php file?

In reply to Gary Johnson

Re: Does anyone have a clean copy of the config.php

by Scott Karren -

Gary

What editor are you using to edit the config.php? That may be what is causing your problems.  You may want to use something like Textpad or another text editor that understand PHP scripts.

In reply to Gary Johnson

Re: Does anyone have a clean copy of the config.php

by Przemyslaw Stencel -

Hi Gary,

Does your config file look like the one in the screenshot? I don't know what setting is responsible for that, but my Notepad also displays the config file without returns. This is why I use AceHTML to edit php files.

Przemek

Attachment config.gif
In reply to Przemyslaw Stencel

Re: Does anyone have a clean copy of the config.php

by Zbigniew Fiedorowicz -
This seems to be due to your having downloaded config.php to your computer in binary mode instead of ascii mode.  The problem is that unix systems terminate lines with the newline character 0x0a only, whereas windows systemes terminate lines with a carriage return + newline pair 0x0d 0x0a. Ascii mode performs a 0x0a --> 0x0d 0x0a conversion during download.
In reply to Gary Johnson

Re: The config.php is not setup so that non-Programmers can edit it

by Rick Blanc -

I have several PHP scripts installed on my servers

php/BB2
Phase
PostNuke

. . . . and there were no issues where to place the date in the variables. Moodle seemingly expects non-techs to participate in the CMS but keeps them at bay from the configuration file by not formatting it where it shows clearly where to plug-in the necessary data.

I am using the HTML-Kit a free and great editor and this same editor managed to add the data into other config.php files why not Moodle?

Please do not send others to the installation manual. It does not give an example of how a config file looks like after it has been edited?

Usually this is what a well formatted config file looks like from php/BB:

$pnconfig['dbtype'] = 'mysql';
$pnconfig['dbhost'] = 'dbhost.com';
$pnconfig['dbpass'] = 'password';
$pnconfig['dbname'] = 'mystydata';

Is this so difficult to do? One thing about doing something when you have a critical mass, when you do it right, you've done it right for thousands of users and reduced your resources for technical help.


Like a defective part
, I think Moodle's config file is unfitting for Moodle and it should be recalled. Yes, it should be sent back and reformatted so that the non-programmer can make sense of it. It should really get a complete make over and have a wizard setup the install. Is Moodle worth the bother? I think so.


Rick / Los Angeles



In reply to Rick Blanc

Re: The config.php is not setup so that non-Programmers can edit it

by Scott Tomassetti -

Great point Rick

I tried to open and understand it in wordpad, but was completely lost!

I then open it is dreamweaver, and Wow! I saw all the instructions as one color and the code as another.  Made all the difference.  Thank you Dreamweaver!

In reply to Scott Tomassetti

Re: The config.php is not setup so that non-Programmers can edit it

by Bruce Moon -
Dreamweaver does make it easier, but I have done it with Notepad before. My experience with Moodle was the first time I used it, I couldn't get it off the ground and gave up. I went off and installed about eight other packages, such as Movable Type, PostNuke, PHPNuke, TikiWiki, Mambo, etc.. Some of these were easier than others.  When I came back to try Moodle, the examples in the config-dist.php file made perfect sense and it was hard to see where I had a problem. I am not a programmer and I thank God for the programmers that are out there and produce open source products.  There are a lot of different ways of implementing Moodle and those that use hosting services have different ways theirs function. I think that may be why things are not clearer. On the positive side, I like the way that the installation program detects problems and suggests changes. Once you understand what the error message means, it is really helpful. But, maybe all of this is making me more of a programmer than I want to admit.  If I am on that road, that would be great, but I think the gulf is a lot larger than just being able to install Moodle!wink
In reply to Rick Blanc

Re: The config.php is not setup so that non-Programmers can edit it

by Tom Murdock -
Hey Rick,

Moodle.org has dozens and dozens of people who can and will help you. Are you asking for help? Or are you having a bad day and kicking cats?

The config-dist.php file does have a very clear equivalent to:

$pnconfig['dbtype'] = 'mysql';
$pnconfig['dbhost'] = 'dbhost.com';
$pnconfig['dbpass'] = 'password';
$pnconfig['dbname'] = 'mystydata';

It looks like this:

$CFG->dbtype = 'mysql'; // mysql or postgres7 (for now)
$CFG->dbhost = 'localhost'; // eg localhost or db.isp.com
$CFG->dbname = 'moodle'; // database name, eg moodle
$CFG->dbuser = 'username'; // your database username
$CFG->dbpass = 'password'; // your database password
$CFG->prefix = 'mdl_'; // Prefix to use for all table names

Except it has plenty of comments tucked around it to explain how to set-it up.

Let us know what you need. Ask and you will receive. From Scott's comment it sounds like you would be better off opening the files in an editor (BBedit, Dreamweaver, or SimpleText on Mac, a few others have been recommended in this thread) that reads php files.

-Tom

p.s. regarding: "Please do not send others to the installation manual" ... When in this thread have you heard someone say RTFM? As my mother says, if you are going to treat us like we are jerks, give us a chance to enjoy the part first.
In reply to Tom Murdock

Re: The config.php is not setup so that non-Programmers can edit it

by Rick Blanc -
Tom,

How many config files are there?
In reply to Rick Blanc

Re: The config.php is not setup so that non-Programmers can edit it

by Bruce Moon -
There is only one. You create it after you make changes in the config-dist.php file and save it as config.php. There are about six places in the config-dist.php file where you have to enter information.
In reply to Rick Blanc

I'm a non-programmer and I DID edit it

by John Gone -
Rick, I think you're somewhat frustrated by your own impatience. Relax and enjoy the support of one of the most helpful and decent communities anywhere. This is a good place full of very nice people. Spend some time here and you'll understand.

Here's a list of editors that may help you to see and understand a bit of what it is you're looking at.

And yes, I believe we all think Moodle is worth a little bit of effort on the users part.
In reply to John Gone

Re: I'm a non-programmer and I DID edit it

by Rick Blanc -
John,

Thank you for your comforting words, I am looking forward in joining the Moodel community and willing to spend more time in getting Moodle installed. Yes I was a bit frustrated when the first step I took collapsed.

Rick
In reply to Rick Blanc

Re: The config.php is not setup so that non-Programmers can edit it

by Howard Miller -
Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers
Is there a reason why you are doing it this way at all? The installation script that runs when you first run Moodle should handle this without you having to edit anything!!
In reply to Scott Tomassetti

Re: Does anyone have a clean copy of the config.php

by António Gonçalves -
The only file I found in the 1.9 moodle is "config-dist.php": there is no config.php. Where do I get it? Tanks Bye António
In reply to António Gonçalves

Re: Does anyone have a clean copy of the config.php

by Mary Cooch -
Picture of Documentation writers Picture of Moodle HQ Picture of Particularly helpful Moodlers Picture of Testers Picture of Translators
Well I have a config.php right under my config-dist.php in my moodle directory .... so I wonder where yours is?EDIT I just saw your other post about your Moodle being hacked - I suggest you download a new version of Moodle and follow these instructions.
In reply to Mary Cooch

Re: Does anyone have a clean copy of the config.php

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

Moodle does *not* come with config.php. If you did not use the automatic installation scripts you have to create it by copying config-dist.php -> config.php and then editing it.

Regarding some other points...

On the point of the format, all Moodle files are formatted for Unix. No one ever managed to agree on things like line endings for text files between different platforms so a choice had to be made.

The answer is to download a decent text editor that will recognise the file type in use. A lot of this is just the curse of Windows though sad
Average of ratings: Useful (1)
In reply to Howard Miller

Re: Does anyone have a clean copy of the config.php

by Mary Cooch -
Picture of Documentation writers Picture of Moodle HQ Picture of Particularly helpful Moodlers Picture of Testers Picture of Translators
Oh thanks Howard re config-php smile (er - now I have to work out where mine came from then... thoughtful )
EDIT.. oh yeah - I remember now- for once, I followed the instructions....
In reply to Gary Johnson

Re: Does anyone have a clean copy of the config.php

by Bryan Williams -

Gary,

Attached is a fresh copy of config-dist.php.  You only need to make modifications in sections 1-4.  Ignore the slashmarks, they simply indicate areas in the code that are commented out for explanation purposes. After you make your changes, insure there are no spaces at the bottom of the file. The last line should read: ?>

Rename the file config.php and upload to the moodle directory.  You should also know that you must make all these changes in a text editor (NotePad, WordPad or SimpleText on Mac), and not a word processor. 

Hope this helps you out.