Moodle ошибка undefined

undefined

After upgrading my Moodle sites to 3.3 I was met with a few errors that were simply undefinable. There was no rhyme nor reason, nor any error message displayed. They were blank. It was inconsistent and frustrating.

The error message was pretty clear once debugging was turned on and the PHP error log was examined:

Deprecated:  Automatically populating $HTTP_RAW_POST_DATA is deprecated and will be removed in a future version. To avoid this warning set 'always_populate_raw_post_data' to '-1' in php.ini and use the php:

Many times I leave deprecated errors and fix them when I get time; however, this one needed to be fixed immediately.

Following the super-helpful PHP notice and the PHP docs, I set

HTTP_RAW_POST_DATA = -1

in my php.ini file and restarted Apache. Just like that, my issue disappeared.

Moodle does document this and says it is specifically for those running PHP 5.6. They also link to an officially posted bug on the PHP tracker. Reading through that, take note, developers, ini_set won’t do anything here.

So, what is this variable? HTTP_RAW_POST_DATA contains all of the raw post data from posting. It seems a tad insecure and is removed completely in PHP 7+.  This isn’t limited to Moodle, so if your code doesn’t need it, and you are running PHP 5.6, go ahead and get that set.

If you are on your own server or have access to php.ini:

$ locate php.ini
$ sudo vi /etc/php.ini

Make sure the below is set with no comment(;):

; Always populate the $HTTP_RAW_POST_DATA variable. PHP's default behavior is
; to disable this feature and it will be removed in a future version.
; If post reading is disabled through enable_post_data_reading,
; $HTTP_RAW_POST_DATA is *NOT* populated.
; http://php.net/always-populate-raw-post-data
always_populate_raw_post_data = -1

Shared server? Apply to your .htaccess file:

php_value always_populate_raw_post_data -1

And, to verify:

Search for “phpinfo” in your Moodle site administration panel. Click on the PHPInfo link, and verify that the setting is set to -1.

raw

I am using moodle for the first time today. I am to look at a site that was built with it. I was getting a blank white screen after login. Then I googled and put a debug line and now it says an error

Fatal error: Call to undefined method core_renderer_maintenance::get_header() in /.../../public_html/theme/genesis/layout/header.php on line 7

New to php too. What is the steps i need to take? ANy help is appreciated. Thanks. If you have questions, please ask.

asked Apr 3, 2014 at 21:55

RookieAppler's user avatar

RookieApplerRookieAppler

1,5175 gold badges23 silver badges58 bronze badges

7

Be sure to have code that calls the core of moodle:

require_once (dirname ( dirname ( dirname ( __FILE__ ) ) ) . '/config.php');

(the amount of dirname depends on where you are)
then you can use the the global variables like $OUTPUT, $PAGE without problem.

echo $OUTPUT->header ();
(your code)
echo $OUTPUT->footer ();

answered Apr 11, 2014 at 3:46

Marcelo's user avatar

MarceloMarcelo

4291 gold badge6 silver badges19 bronze badges

  • Home
  • Forums
  • Technical
  • Virtual Learning Platforms
  • Moodle — undefined variable error

  • Data loading…

Virtual Learning Platforms Thread, Moodle — undefined variable error in Technical; Hi I have set up moodle for the school on a windows 2003 server, IIS6, PHP 5.2, Moodle vers 1.8.

  1. 26th September 2007, 08:10 AM #1

    damienharrison is offline


    Rep Power
    35

    Hi I have set up moodle for the school on a windows 2003 server, IIS6, PHP 5.2, Moodle vers 1.8.

    When navigating to — http://www.primrose.leeds.sch.uk/moo…ndex.php?id=30

    We get the following error

    Notice: Undefined variable: maxgrade in C:\Inetpub\wwwroot\moodle\mod\assignment\lib.php on line 1894

    Notice: Undefined variable: maxgrade in C:\Inetpub\wwwroot\moodle\mod\assignment\lib.php on line 1894

    Notice: Undefined variable: maxgrade in C:\Inetpub\wwwroot\moodle\mod\assignment\lib.php on line 1894

    Notice: Undefined variable: maxgrade in C:\Inetpub\wwwroot\moodle\mod\assignment\lib.php on line 1894

    Notice: Undefined variable: maxgrade in C:\Inetpub\wwwroot\moodle\mod\assignment\lib.php on line 1894

    Notice: Undefined variable: maxgrade in C:\Inetpub\wwwroot\moodle\mod\assignment\lib.php on line 1894

    from what I have managed to gather from the Moodle forums it seems to be a gradebook problem but i have no idea on a fix for this.

    Any suggestions from anyone on fixes for this

    Kind regards

    Damien Harrison


  2. 26th September 2007, 08:14 AM #2

    Re: Moodle — undefined variable error

    It’s just a warning and nothing serious to worry about — just tone down your PHP error reporting level in php.ini.

    PHP performance is very poor on IIS, you could do worse than atleast running it under Apache on Windows. Apache on *nix would be even better.


  3. 26th September 2007, 08:46 AM #3

    damienharrison is offline


    Rep Power
    35

    Re: Moodle — undefined variable error

    PHP seems to run quite well 200+ users on moodle and no problems (apart from my network manager who insists on installing all new patches, SP’s and other stuff without reading what it says it does on the tin)

    Regards

    Damien


  4. 26th September 2007, 08:50 AM #4

    damienharrison is offline


    Rep Power
    35

    Re: Moodle — undefined variable error

    PHP seems to run quite well 200+ users on moodle and no problems (apart from my network manager who insists on installing all new patches, SP’s and other stuff without reading what it says it does on the tin)

    Regards

    Damien


  5. 26th September 2007, 08:57 AM #5

    Re: Moodle — undefined variable error

    You can change the error level reporting method and level from within Moodle. If you go to Site Administration -> Server -> Debugging you will find the controls there to alter the settings that affect this.


  6. 26th September 2007, 10:15 AM #6

    damienharrison is offline


    Rep Power
    35

    Re: Moodle — undefined variable error


SHARE:

Similar Threads

  1. Moodle help

    By firefox_2006 in forum Virtual Learning Platforms

    Replies: 20

    Last Post: 18th October 2007, 01:45 PM

  2. Replies: 2

    Last Post: 22nd May 2007, 12:22 PM

  3. Replies: 5

    Last Post: 13th December 2006, 11:09 PM

  4. Replies: 16

    Last Post: 23rd November 2006, 09:07 PM

  5. Replies: 6

    Last Post: 26th January 2006, 11:12 PM

  • Home
  • Moodle — undefined variable error

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Solution for Eguru Theme Image Display Error in Moodle

If you are experiencing an error with the Eguru theme installed in Moodle where the images are not displayed and you receive the error message “Excepción – Call to undefined function sibil@gmail.com() error/moodle/generalexceptionmessage,” there are a few steps you can take to troubleshoot and resolve the issue:

  1. Check the file permissions for the theme’s image folder. Make sure that the permissions are set to allow read access for the web server user.
  2. Verify that the images exist in the correct location within the theme’s image folder. If they are not in the correct location, move them to the correct directory.

  3. Try clearing the Moodle cache. Sometimes cached data can cause issues with theme display.

  4. Ensure that the theme is properly installed and configured. If the theme installation was not completed correctly, it could cause issues with image display.

  5. If none of the above steps help, try reinstalling the Eguru theme to ensure that all files and directories are correctly installed.

Hopefully, one of these steps will help you resolve the issue with the Eguru theme images not displaying in Moodle. If not, it may be necessary to seek additional support from the Moodle community or an IT expert.

Я установил LAMP с PHP 5.4.16, Maria DB и Moodle 3.1.7 в Red Hat Enterprise Linux 7.

Я установил его с

sudo yum install moodle

Когда я нажимаю кнопку «Добавить действие или ресурс», открывается всплывающее окно для выбора действия / ресурса, но когда я нажимаю кнопку «Добавить», я получаю пустой экран (Chrome сообщает HTTP 500).

Когда я включаю отладку, я получаю это:

...moodle/course/modedit.php?add=folder&type=&course=2§ion=0&return=0&sr=0 Fatal error: Call to undefined method tool_lp_course_competencies_form_element::tool_lp_course_competencies_form_element() in /usr/share/pear/HTML/QuickForm/element.php on line 375

Я не изменил никакого исходного кода. Что может быть причиной этого?

С наилучшими пожеланиями,
Бьорн

0

Решение

Когда я включаю отладку, я получаю следующую ошибку:
… Мудл / курс / modedit.php? = Добавить папку&тип =&Конечно = 2§ion = 0&вернуться = 0&sr = 0 Неустранимая ошибка: вызов неопределенного метода tool_lp_course_competencies_form_element :: tool_lp_course_competencies_form_element () в /usr/share/pear/HTML/QuickForm/element.php в строке 375

Мое (слабое) решение:
Когда я выключаю компетенции под
Администрирование -> Администрирование сайта -> Компетенции -> Настройки компетенций -> Включить компетенции
оно работает.
Если у кого-то есть лучшее решение, пожалуйста, скажите мне.

0

Другие решения

Других решений пока нет …

Понравилась статья? Поделить с друзьями:
  • Monster girl quest paradox ошибка
  • Moodle ошибка 1004
  • Moodle журнал ошибок
  • Mizar vavilon ошибка e4
  • Montair коды ошибок