Editing moodle.php

Editing moodle.php

Abdalla Yousif -
回帖数:13

Hi

I am using moodle 1.9+ for my course site, and edited some strings in moodle.php such as changing message " You are logged as....." to be "Welcome to sitename....." and similar messages.

I did that through admin/language/lang editing , nothing change, and also going manually to moodle.php and change it without success.

Does this version allows this kind of change? if yes why is not changing it? if not, how can I do that?

Please help.

thnaks

回复Abdalla Yousif

Re: Editing moodle.php

Nehad Hroub -
Hi Abdalla Yousif,

I had this problem while ago, the Moodle dos not accept any changes in it is code.
To do this you must be reinstall the Moodle after added your changes.

Best.

/Nehad

回复Nehad Hroub

Re: Editing moodle.php

Abdalla Yousif -

Thanks Nehad;

I have a question, when you reinstall moodle this is not going to overwrite moodel.php the one you edit it, is it?

thanks again

回复Abdalla Yousif

Re: Editing moodle.php

Mauno Korpelainen -

Usually the reason for non-sticking changes to php files is eaccelerator (enabled).

If you are using for example the Complete Windows package it has by default PHP eaccelerator enabled and you need to edit your php.ini file (found from server\php folder) and change

eaccelerator.enable = "1"

to

eaccelerator.enable = "0"

or comment that line out with semicolon.

Then save php.ini and restart your apache/server (XAMPP)

No need to reinstall moodle wink.

回复Mauno Korpelainen

Re: Editing moodle.php

David Mudrák -
Core developers的头像 Documentation writers的头像 Moodle HQ的头像 Particularly helpful Moodlers的头像 Peer reviewers的头像 Plugin developers的头像 Plugins guardians的头像 Testers的头像 Translators的头像
Mauno is right. Definitely neither reinstall your Moodle nor kill any kittens to make this work. Using the in-built tool for language customization is the right way.

Moving this thread into Languages forum.
回复Mauno Korpelainen

Re: Editing moodle.php

edward luarca -
mauno's suggestion worked for me. although leaving it enabled helps moodle performance. so i disable it whenever i make a change, then re-enable afterwards.
回复Mauno Korpelainen

Re: Editing moodle.php

Paul Broekhof -

Mauno, your advice just saved me some serious headache. I had no idea why my changes to any of the php files were ignored, until I read your post and changed my php.ini. Thank you very much indeed!

回复Mauno Korpelainen

Re: Editing moodle.php

Stephanie Singer -

My moodle is hosted with a reliable third-party webhost (Dreamhost). They do *not* have eAccelerator enabled in the php installation that is underlying my moodle installation. Yet my changes to moodle.php (via the Language Editor) do not show up on my site.

Please advise!

回复Stephanie Singer

Re: Editing moodle.php

Robert Brenstein -
Moodle itself does some language caching. Moodle 2 actually quite actively (you don't say which version you have) and has some administrative options related to that. Local browser can also cache things for you as well as some proxy in between. Caching is the issue if you re-edit the moodle.php file and your changes are there but you still do not see them in your browser. The issue originally discussed in this thread was that the changes were disappearing.
回复Robert Brenstein

Re: Editing moodle.php

Stephanie Singer -

I'm using 1.9.10.

When I look at the moodle.php file in the language editor, I see the changes I've made, so I believe that the moodle.php file has the changes. I still do not see them in my browser. If I understand you correctly, caching is the issue. What should I do?

Thank you for your quick reply!

回复Abdalla Yousif

Re: Editing moodle.php

Trevor Cunningham -
I've had the same problem. A work-around, without re-installing, is to edit the moodle.php file at the server level through your file manager. The file can be found in domain/(your moodle foler)/lang/(your language pack)
回复Trevor Cunningham

Re: Editing moodle.php

Joseph Rézeau -
Core developers的头像 Particularly helpful Moodlers的头像 Plugin developers的头像 Testers的头像 Translators的头像
Hi Trevor,
Editing the moodle.php file is a very bad idea! Please use the language editing feature, as explained by others in this thread.
Joseph