Fatal erro on wiki edit

Fatal erro on wiki edit

by Ronaldo Reis Jr. -
Number of replies: 11
Fatal error: Cannot redeclare wiki_add_instance() (previously declared in /var/www/termix/moodle/mod/wiki/lib.php:14) in /var/www/termix/moodle/mod/wiki/lib.php on line 14
Average of ratings: -
In reply to Ronaldo Reis Jr.

Re: Fatal erro on wiki edit

by Florencio Fernández -
Hi Ronaldo,

I have de same problem:

Cannot redeclare wiki_add_instance() in /var/www/moodle/mod/wiki/lib.php on line 14

¿did you found the solution?

Thanks,

Floren
In reply to Ronaldo Reis Jr.

Re: Fatal erro on wiki edit

by Charlie Balch -

I'm having the same error - does anybody have a solution?

Thanks,

Charlie

In reply to Charlie Balch

Re: Fatal erro on wiki edit

by Eloy Lafuente (stronk7) -
Picture of Core developers Picture of Documentation writers Picture of Moodle HQ Picture of Peer reviewers Picture of Plugin developers Picture of Testers
Hi Charlie,

could you provide some more info? (Moodle's version, full error, page showing the error, action that triggers it...)

TIA and ciao smile
In reply to Eloy Lafuente (stronk7)

Re: Fatal erro on wiki edit

by Charlie Balch -

Hi back Eloy,

I updated to the latest version about two weeks ago.  I'm not sure what version that is and could not easilly find the version number.

Since the upgrade, none of my Wiki pages work. This includes both old and new pages.

The site is http://jelt.org

The error is:

Fatal error: Cannot redeclare wiki_add_instance() (previously declared in D:\inetpub\balch\md\mod\wiki\lib.php:14) in D:\Inetpub\balch\md\mod\wiki\lib.php on line 14

In reply to Charlie Balch

Re: Fatal erro on wiki edit

by Eloy Lafuente (stronk7) -
Picture of Core developers Picture of Documentation writers Picture of Moodle HQ Picture of Peer reviewers Picture of Plugin developers Picture of Testers
Hi Charlie,

Could you try changing the capitalisation of your $CFG->dirroot setting from "Inetpub" to "inetpub" or vice-versa?

It seems that your Win32 box has some sort of problem, not detecting such paths as previously included. Strange...!

That's all I've been able to imagine (although it doesn't produce such result under my XP box).

Hope it helps, ciao smile
In reply to Eloy Lafuente (stronk7)

Re: Fatal erro on wiki edit

by Charlie Balch -

Thanks Eloy,

That sounds like it might be something that would help but I don't know where ot change my $CFG dirroot setting.  I'm using a shared box which may be part of the problem.  I also recently moved one shared server to another so the path may have changed spelling as you note.

Where do I change my $CFG settings?

Thanks,

Charlie

In reply to Charlie Balch

Re: Fatal erro on wiki edit

by Eloy Lafuente (stronk7) -
Picture of Core developers Picture of Documentation writers Picture of Moodle HQ Picture of Peer reviewers Picture of Plugin developers Picture of Testers
yep, such setting should be in this file:

D:\inetpub\balch\md\config.php

and the line you've to change (the "i" of "inetpub" from lowercase to uppercase or the opposite) is that starting by:

$CFG->dirroot

Ciao smile
In reply to Eloy Lafuente (stronk7)

Re: Fatal erro on wiki edit

by Charlie Balch -

Many thanks Eloy!  Your suggestion appears to have fixed the problem.

Charlie Eloy is the best

In reply to Eloy Lafuente (stronk7)

Re: Fatal erro on wiki edit

by Matt Campbell -
I've just had an instructor showing me the same thing.  I'm using 1.5.3 and the error is:

Fatal error: Cannot redeclare wiki_add_instance() (previously declared in /usr/share/moodle/mod/wiki/lib.php:14) in /usr/share/moodle/mod/wiki/lib.php on line 14

It happens when trying to edit a wiki.  You can create new wikis just fine, but you can't edit any.  This happens for teachers, course creators, and admins.  My config.php has this for my path:

$CFG->dirroot = '/usr/share/moodle';

I have another moodle installation that works just fine.
Attachment wiki_error.JPG
In reply to Matt Campbell

Re: Fatal erro on wiki edit

by Matt Campbell -
Just missed the edit window....

This is using ewiki.

I turned on debug mode and now get:

Notice: Constant EWIKI_ESCAPE_AT already defined in /usr/share/moodle/mod/wiki/lib.php on line 12

Fatal error: Cannot redeclare wiki_add_instance() (previously declared in /usr/share/moodle/mod/wiki/lib.php:14) in /usr/share/moodle/mod/wiki/lib.php on line 14

I went to Config->Filters and disabled Wiki Page Auto-Linking and now I can update my Wikis.  I went to my other site and found this filter enabled, so it isn't the source of my problem.

Thanks again,
Matt
In reply to Matt Campbell

Re: Fatal erro on wiki edit

by Eloy Lafuente (stronk7) -
Picture of Core developers Picture of Documentation writers Picture of Moodle HQ Picture of Peer reviewers Picture of Plugin developers Picture of Testers
Hi Matt,

any PHP-acellerator running in your server? Could you delete its cache? It seems that the same file, "/usr/share/moodle/mod/wiki/lib.php" is being included twice, but all the includes I've found are include/require_once() so it shouldn't happen at all.

All I can imagine is that "something" has two versions of the same file and it's causing the error... but I'm not able to reproduce it in my server... sad

Ciao smile