Исправление ошибок moodle

Error: database connection failed

If you get errors like «database connection failed» or «could not connect to the database you specified», here are some possible reasons and some possible solutions.

  • Your database server isn’t installed or running. To check this for MySQL try typing the following command line
$telnet database_host_name 3306
You should get a cryptic response which includes the version number of the MySQL server.
  • If you are attempting to run two instances of Moodle on different ports, use the ip address of the host (not localhost) in the $CFG->dbhost setting, e.g. $CFG->dbhost = 127.0.0.1:3308.
  • You don’t have the PHP mysql or postgresql extensions installed (please refer to FAQ re. whether PHP is installed).
  • You haven’t created a Moodle database and assigned a user with the correct privileges to access it.
  • The Moodle database settings are incorrect. The database name, database user or database user password in your Moodle configuration file config.php are incorrect. Use phpMyAdmin to set up and check your MySQL installation.
  • Check that there are no apostrophes or non-alphabetic letters in your MySQL username or password.
  • You are using MySQL version 4.1 or higher but the PHP MySQL extension is pre-4.1 (check in your phpinfo output). In this case the default password hashing algorithm is incompatible with that available in the PHP mysql extension versions 4.x.x. Use these MySQL commands to change the passwords to the old format:
mysql>SET PASSWORD FOR 'root'@'localhost' = OLD_PASSWORD('password');
mysql>SET PASSWORD FOR 'moodleuser'@'localhost' = OLD_PASSWORD('password');
Also, consider upgrading your PHP MySQL extension. See this MySQL document for further information on how to deal with this problem.
  • You are using Fedora core 3 or some other Linux system with SELinux installed and enabled. See the following URL for information on how to disable SELinux: http://fedora.redhat.com/projects/selinux/ If you don’t want to disable SELinux, you have to allow httpd process to create network connections:
setsebool httpd_can_network_connect true

  • Mac OSX users—if you are running MySQL on a Mac OSX, try changing $CFG->dbhost from ‘localhost’ to ‘127.0.0.1’

See also: MySQL page on common errors which lists several possible scenarios for connection failure, with advice on how to fix the problems.

I can’t log in with message «Please verify that the current setting of session.save_path is correct»

This error occurs when PHP is having problems saving its session files. You may also see these other error messages displayed on the screen or in your log files:

Warning: Unknown: open(some-path/sessions/sess_acbf942a7399db3489ffa910e35d5242, O_RDWR)
failed: Permission denied (13) in Unknown on line 0
Warning: Unknown(): open(some-path/sessions/sess_acbf942a7399db3489ffa910e35d5242, O_RDWR) 
failed: No space left on device (28) in Unknown on line 0
Warning: Unknown: Failed to write session data (files). Please verify that the current 
setting of session.save_path is correct (some-path/sessions) in Unknown on line 0 

To temporarily bypass these errors, use database sessions by editing your moodle configuration file and adding this line:

$CFG->dbsessions = true;

Database sessions may overload your mysql database and are not ideal in a shared hosting environment, so if this solves the problem, you can start fixing the problem as follows:

  • Check access rights. The session.save_path should be accessible by the apache user. Try this command:
chown -R apache:apache some-path/sessions
This assumes that ‘apache’ is the name of the user your webserver runs under — it could also be ‘nobody’.
  • Check the permissions to the directory that PHP is trying to save to (session.save_path = some-path/sessions). Set the permissions initially to 0777 (everyone read, write, execute) with this command:
chmod -R 0777 some-path/sessions
If this fixes the problem, reduce the permissions (700 is recommended).

See also: Session problems can be specific to your server environment. As an example, see this forum discussion about session problems with Lycos hosting.

Error: A server error that affects your login session was detected

If restarting your browser and logging in again to your Moodle site does not work, see the Using Moodle forum discussion about this error message.

If this was received at a Moodle.org site, the site could be in the process of updating. Please try the suggestion and/or wait and try it again. Or report it in Tracker.

Error: Failed opening required ‘/web/moodle/lib/setup.php’

In your config.php, the setting that you use for the dirroot variable must be the complete path from the root of your server’s hard drive.

Sometimes people only use the path from their home directory, or relative to the root of the web server directory.

My pages show fatal errors such as : Parse error, call to undefined function: get_string()

If you see errors like:

Parse error: parse error, unexpected T_VARIABLE in /path/to/moodle/config.php on line 94 
Fatal error: Call to undefined function: get_string() in /path/to/moodle/mod/resource/lib.php
on line 11

then you have probably left out a semi-colon or closing quote from a line in config.php (previous to line 94).

Another possibility is that you edited config.php in a program like Word and saved it as a HTML web page, instead of using a plain text editor like Notepad++.

Another thing to check, particularly if you are using additional plugins, is whether any of the php scripts use short open tags (<? ?>) instead of proper ones (<?php ?>). Short tags are bad for various reasons, so first contact the author of that extension to tell them about the problem. Then either replace short tags with conventional ones, or set this line in php.ini:

short_open_tag = On

You should never find short tags in core moodle code. If you do, please file a bug in the tracker.

When I go to the admin page, I get told to make dirroot blank!

If you see errors like this:

Please fix your settings in config.php: 
You have: $CFG->dirroot = "/home/users/fred/public_html/moodle"; 
but it should be: $CFG->dirroot = "";

then you have encountered a small bug that occurs on some servers. The problem is with the error-checking mechanism, not with your actual path. To fix it, find this line (line 66) in the file admin/index.php:

if ($dirroot != $CFG->dirroot) {

and change it to this:

if (!empty($dirroot) and $dirroot != $CFG->dirroot) {

If you see errors like this:

Warning: Cannot add header information - headers already sent by 
(output started at /webs/moodle/config.php:87) in /webs/moodle/lib/moodlelib.php 
on line 1322 
Warning: Cannot add header information - headers already sent by 
(output started at /webs/moodle/config.php:87) in /webs/moodle/lib/moodlelib.php 
on line 1323 
Warning: Cannot add header information - headers already sent by 
(output started at /webs/moodle/config.php:87) in /webs/moodle/login/index.php 
on line 54

you have blank lines or spaces after the final ?> in your config.php file. Sometimes text editors add these — for example Notepad on Windows — so you may have to try a different text editor (e.g., Notepad++ to remove these spaces or blank lines completely.

Error: «500:Internal Server Error»

There are several possible causes for this error. It is a good idea to start by checking your web server error log which should have a more comprehensive explanation. However, here are some known possibilities….

1. Syntax error: There is a syntax error in your .htaccess or httpd.conf files. The way in which directives are written differs depending on which file you are using. You can test for configuration errors in your Apache files using the command:

#apachectl configtest

2. PHPsuexec: Your server does not support .htaccess files, especially if it is running PHPsuexec, which is an Apache module used for increasing the security of a site on a hosted system. In this situation:

— you may also see a 403: Forbidden error.

— the webserver executes under your own username and all files have a maximum permissions level of 755. Check that this is set for your Moodle directory in your control panel or (if you have access to the shell) use this command:

#chmod -R 755 moodle

— use a PHP.INI file instead of a .htaccess in the directory where the Moodle PHP script is being executed. For example: if you are receiving a memory exhausted error when your server is executing the file moodle/admin/cron.php, use a PHP.INI file to change your memory_limit and copy it to the moodle/admin directory. Remember that for PHP4, PHP.INI files are per-directory, so you’ll need to copy it to each sub-directory. If you are using PHP5 or higher on a shared host, check with your host on whether they support custom PHP.INI files, and how to create them. The syntax used in a PHP.INI file is different from a .htaccess file and you need to take out php_value/php_flag at the beginning of the line and use an equals sign to assign a value, e.g.

php_value memory_limit 128M <-- .htaccess
memory_limit = 128M         <-- php.ini equivalent 

3. Incompatible directive: You may have a directive in your .htaccess or httpd.conf files which are not compatible with your web server version. Check your webserver documentation.

Error «403: Forbidden»

Check your webserver configuration. See also the section above «500:Internal Server Error».

Fatal error allowed memory size exhausted. How do I increase my php memory limit?

You will sometimes see an error message something like this:

Fatal error: Allowed memory size of 67108864 bytes exhausted 
(tried to allocate xx bytes) in /var/www/moodle/yyyy.php

This error means that the php memory_limit value is not enough for the php script. The memory_limit value is the «allowed memory size» — 64M in the example above (67108864 bytes / 1024 = 65536 KB. 65536 KB / 1024 = 64 MB). You will need to increase the php memory_limit value until this message is not shown anymore. There are two methods of doing this.

  • On a hosted installation you should ask your host’s support how to do this. However, many allow .htaccess files. If yours does, add the following line to your .htaccess file (or create one in the moodle directory if it does not already exist):
php_value memory_limit <value>M
Example: php_value memory_limit 40M
  • If you have your own server with shell access, edit your php.ini file (make sure it’s the correct one by checking in your phpinfo output) as follows:
memory_limit <value>M
Example: memory_limit 40M
  • For later versions of Moodle you could be looking at figures in the region of 512M for all functions to work properly (backup and restore are particularly memory hungry). It is sensible to monitor the memory usage on your server if using these large settings.

Remember that you need to restart your web server to make changes to php.ini effective. An alternative is to disable the memory_limit by using the command memory_limit 0.

Error: «Your session has timed out. Please login again.» or «The page isn’t redirecting properly» or «This webpage has a redirect loop»

Please do one/all of the following:

  • Try deleting cookies manually from your browser and close it down, then access your site again. Sometimes this clears up the problem.
  • Check that your moodledata/sessions directory has write permissions. When you access Moodle a new file should be created there.
  • If you are running two versions of Moodle on the same computer, set a cookie prefix in Administration > Server > Session handling.

The discussion Your session has timed out. Please login again has further suggested solutions:

  • Browse to: http://yoursite/subdir/admin/purgecaches.php , it should prompt you to login first and then redirect to a page that has a button to purge all caches.
  • If you can access your server files, go to the ‘moodledata’ folder, go to the ‘cache’ folder inside and erase all the contents there (usually only two files). Moodle will delete the frozen session with the redirect loop and Moodle will work again.

Error when installing: ERR_TOO_MANY_REDIRECTS

  • You will need to edit the moodle\admin\index.php file with a file editor such as Notepad++. Do not use MS-Word!
  • Search for a line that has:
redirect("index.php?sessionstarted=1&lang=$CFG->lang");
  • and add two inverted slashes to comment it out like this:
//redirect("index.php?sessionstarted=1&lang=$CFG->lang");
  • and try to continue with the installation from your browser.

Fatal error: Maximum execution time of 30 seconds exceeded in…(when installing)

  • Your computer is taking too much time to execute the installation scripts. The default value used to be 30 seconds (but some new Moodle branches have increased it).
  • Press F5 (refresh) until it finishes the installation process.
  • Or, edit the file at your_local_server\server\php\php.ini using a text editor such as Notepad++. Do not use MS-Word!
    • Look for a line that has:
max_execution_time = 30
    • And substituthe the 30 seconds value for a much longer time; e.g., 600, so that it looks like:
max_execution_time = 600
    • Save the edited file and restart the local server installation

Error when installing: The connection was reset/This site can’t be reached

Install ERROR This site cant be reached.png

Did you install or upgrade Skype ?

  • Skype uses the same port (80) as Moodle.
  • Remove Skype.
  • Restart Windows.
  • Install Moodle and
  • Re-install Skype.

Check the PC with a good antivirus

  • Be very cautious when choosing a free/paid Windows antivirus.
  • Good places to look for are old, reliable, solid PC magazines and old, reliable, solid PC blogs.
  • Beware of many malicious malware programs posing as antivirus solutions!
  • It may be worth asking your local IT expert, or Google for any chosen solution, before installing it.

Increase the time allowed for running scripts in Moodle

Localhost connection was restarted.png

  • Click ‘Stop Moodle.exe’
  • Edit (use Notepad++ or other simple text editor; do NOT use MS-Word) the file server/php/php.ini and increase the number in the line that states max_execution_time = :

Edit max execution time.png

  • Increase the value to, let’s say, 10 minutes (600 seconds):

Edit max execution time to 600.png

  • Click ‘Start Moodle.exe’
  • Check if the problem was solved; if not, continue reading below.

Check if you need to increase Apache’s default stack size

  • This problem has been described in Windows 7 PCs and laptops with Moodle 3.4, 3.5 and 3.6 Moodle for Windows complete install packages.
  • If you check the error.log file at server/apache/logs/error.log and you find a line with
child process XXXX exited with status 3221226356 -- Restarting. 
    • (where XXXX is a number, any number)

child process XXXX exited with status 3221226356.png

  • you may have a problem that often happens in Windows because of smaller Apache’s default stack size. And it usually happens when working with php code that allocates a lot of stacks.
  • To solve this issue, use a text editor (such as Notepad++, DO NOT USE MS-WORD) to add the following three lines at the end of apache config file (../server/apache/conf/httpd.conf) :
<IfModule mpm_winnt_module>
  ThreadStackSize 8888888
</IfModule>
  • AND restart apache.

Do you have Google Drive?

  • Heap corruption (STATUS_HEAP_CORRUPTION). Some programs like Google Drive may be causing heap corruption.
  • Switching to the latest version of Apache (XAMPP) may fix the issue.

Are you using XAMPP?

Go to XAMPP-Cotroll and open Apache->Config->httpd.conf and add

<IfModule mpm_winnt_module>
  ThreadStackSize 8888888
</IfModule>

to the end

See https://moodle.org/mod/forum/discuss.php?d=38758

How can I fix just one bug, without upgrading my whole site?

Suppose:

  • You are running an older Moodle version.
  • You are experiencing a particular bug.
  • You have searched in the tracker, and found that your problem is MDL-abc, and that it has been fixed in the latest version.
  • For some reason, you cannot upgrade your whole site, even though the latest version probably has security fixes.

Then, how can you get the fix for just this one bug, without upgrading your whole site? Well, if you are prepared to manually patch the code, you can probably get this information from the tracker. Please see this guide.

Error: ‘undefined’ message

This may be related to the langconfig.php setting for ‘locale’ in your language pack. Please contact your language pack maintainer.

ERROR undefined.png

See also

  • Category:Error for a list of Moodle error pages.

Moodle: ошибки при загрузке курса (зависание процесса восстановления)

Дано: Moodle 3.2 и резервная копия курса в формате mbz. Параметры системы — Windows Server 2012 R2 + MS SQL Server + IIS
Проблема: при попытке загрузить (восстановить) курс страница зависает, долго грузится и в итоге приводит к ошибке «Невозможно отобразить страницу».
Причина, описанная ниже: это некорректный контент курса.

Причины ошибок восстановления могут быть разные (начиная от несовместимости версий Moodle и заканчивая банальной нехваткой места на сервере). Я приведу ту, что возникла у меня. Доступа к исходному курсу (из которого выгружался бэкап) у меня не было, был на руках только файл архива курса в формате mbz.
Восстановление делается по стандартной схеме описанной в данной инструкции — Как загрузить курс в Moodle из резервной копии.
При нажатии на кнопку «Приступить к восстановлению» страница делала вид, что происходит какой-то процесс, но ожидание даже в течении часа ни к чему не приводило (в итоге срабатывал timeout с выводом стандартной ошибки страницы). Если это делалось непосредственно на сервере, то процесс мог зависнуть так, что приходилось делать рестарт веб-сервера (в нашем случае IIS reset).

Включение дебаг режима также не давало результата: никаких вменяемых сообщений об ошибках не выводилось. Логи веб-сервера, логи PHP и системные логи также молчали.

Помог только следующий способ.
(естественно все попытки делаем в тестовой версии moodle)
Когда страница зависает, ожидаем несколько минут, затем останавливаем процесс и заходим в курс. Смотрим, что загрузилось, что нет.
Анализируем последний по порядку загруженный элемент, скорее всего проблема именно в его содержимом, на котором «спотыкается» загрузка курса. Далее можно попытаться изучить его содержимое, если хоть что-то относящееся к нему загрузилось, либо можно пытаться найти его непосредственно в mbz файле и посмотреть контент.
Если надо просто быстро проверить, является ли он причиной зависания, то на этапе выбора элементов перед загрузкой, снимите «флажок» около этого элемента и попробуйте загрузить курс заново. Если не помогло, то уберите загрузку следующего по порядку элемента.
В моем случае это помогло, но при повторной загрузке страница снова зависла. Оказалось, в курсе было три таких элемента (в терминах Moodle — файл и две книги). Т.е. загрузка курса продвинулась дальше, но снова спотыкалась на следующем элементе. Когда эти три элемента были исключены из загрузки, курс успешно восстановился до конца.
По моим предположениям причина была в том, что данные элементы содержали javascript-файлы (возможно срабатывала «отсечка» на уровне безопасности веб-сервера).

Если ничего не помогает, то лучше загружать курс частями и анализировать те части, на которых появляется ошибка.

Если Вам понравилась статья, пожалуйста, поставьте лайк, сделайте репост или оставьте комментарий. Если у Вас есть какие-либо замечания, также пишите комментарии.

Learning Management System (LMS) Moodle – это популярная платформа для создания и управления образовательными курсами онлайн. Она предоставляет широкие возможности для взаимодействия между учителями и студентами, а также обеспечивает удобный доступ к материалам и заданиям. Однако, иногда пользователи сталкиваются с проблемой – Moodle не запускается.

Основная причина, по которой Moodle не запускается, – это ошибка в настройках сервера или приложения. Неправильно указанные параметры могут привести к неработоспособности системы. Например, ошибка в файле конфигурации сервера Apache или неверно указанные настройки базы данных могут вызвать проблемы с запуском Moodle.

Другой распространенной причиной неработоспособности Moodle является проблема с установленными плагинами или темами. Если при установке нового плагина или темы возникла ошибка, это может привести к сбое системы. В таком случае необходимо проверить совместимость установленных плагинов и тем с используемой версией Moodle и дополнительно выполнить необходимые обновления.

Неработоспособность Moodle также может быть связана с проблемами сетевого соединения или неправильными настройками DNS. Если пользователь не может получить доступ к серверу Moodle или система некорректно отображается в браузере, следует проверить наличие интернет-соединения и правильность настроек сети.

Содержание

  1. Ошибка в настройках сервера
  2. Ошибка в файле конфигурации Moodle
  3. Неправильно установленные права доступа
  4. Проблемы с базой данных
  5. Недостаточные ресурсы сервера
  6. Проблемы с памятью сервера

Ошибка в настройках сервера

Одной из основных причин неработоспособности Moodle может быть ошибка в настройках сервера.

Неправильные и некорректные настройки сервера могут привести к неработоспособности Moodle и вызывать различные проблемы с его запуском. Вот некоторые распространенные ошибки в настройках сервера, которые могут вызвать проблемы с Moodle:

1. Ошибки в конфигурационных файлах: Неправильные настройки в файле конфигурации Moodle (config.php) могут привести к неработоспособности системы. Убедитесь, что файл конфигурации содержит правильные настройки для вашего сервера.

2. Ограничения на сервере: Некоторые серверы могут иметь ограничения на использование определенных функций, например, функции mail(). Убедитесь, что ваш сервер не ограничивает или блокирует необходимые функции для работы Moodle.

3. Проблемы с правами доступа: Неправильно установленные права доступа на файлы и папки Moodle могут привести к неработоспособности системы. Убедитесь, что права доступа на файлы и папки установлены правильно и что веб-сервер имеет достаточные права на доступ к ним.

Исправление ошибок в настройках сервера может потребовать некоторого технического опыта. Если вы не уверены, что делаете, лучше обратитесь за помощью к администратору сервера или к команде технической поддержки Moodle.

Ошибка в файле конфигурации Moodle

Для исправления ошибки в файле конфигурации, следуйте следующим шагам:

  1. Убедитесь, что вы правильно скопировали файл конфигурации Moodle при его установке. Проверьте, существует ли файл в правильной директории и содержит ли он правильные данные.
  2. Откройте файл конфигурации с помощью текстового редактора и проверьте синтаксис. Возможно, вы сделали опечатку или допустили другую ошибку при внесении настроек.
  3. Проверьте наличие всех необходимых настроек в файле конфигурации. Убедитесь, что вы указали правильные параметры для базы данных, хоста и других параметров.
  4. Если вы изменили какие-либо настройки, убедитесь, что все переменные и значения записаны корректно и не содержат опечаток.
  5. Сохраните изменения в файле конфигурации и перезапустите Moodle. Если ошибка была исправлена, система должна запуститься без проблем.

Если проблема не устранена после проверки файла конфигурации, рекомендуется обратиться к документации Moodle или обратиться за помощью к специалистам поддержки. Они могут помочь вам найти и исправить проблему с файлом конфигурации, чтобы Moodle запустился без ошибок.

Неправильно установленные права доступа

Вот несколько возможных причин, почему права доступа могут быть установлены неправильно:

  • Ошибка при установке или обновлении Moodle.
  • Неправильные настройки сервера или хостинга.
  • Неправильные настройки файловой системы.
  • Поврежденные файлы или база данных Moodle.

Для исправления проблем с правами доступа в Moodle можно предпринять следующие действия:

  1. Проверить, что все файлы и папки в установленной директории имеют правильные права доступа. Рекомендуется установить права доступа 755 для папок и 644 для файлов.
  2. Убедиться, что пользователь сервера, на котором установлен Moodle, имеет доступ для чтения и записи к необходимым файлам и папкам.
  3. Проверить, что все настройки сервера и хостинга соответствуют требованиям Moodle.
  4. Восстановить поврежденные файлы или базу данных, используя инструменты восстановления Moodle.

Если необходимо изменить права доступа, это можно сделать с помощью FTP-клиента или SSH-команд.

Правильное установление прав доступа – важный шаг для успешного запуска Moodle. Убедитесь, что все права установлены правильно, и в случае проблем следуйте рекомендациям по исправлению.

Проблемы с базой данных

  • Отсутствие или неправильные параметры подключения к базе данных: Возможно, вы не указали правильные параметры подключения к базе данных в конфигурационных файлах Moodle. Убедитесь, что вы правильно указали имя базы данных, пользователя и пароль. Также проверьте, что база данных действительно доступна и работает.
  • Недостаточные привилегии учетной записи базы данных: Если учетная запись базы данных, указанная в конфигурационных файлах Moodle, не имеет достаточных привилегий, то Moodle не сможет правильно работать с базой данных. Убедитесь, что учетная запись имеет все необходимые привилегии для чтения, записи и изменения таблиц базы данных.
  • Поврежденная база данных: Если база данных Moodle повреждена, то Moodle может не запускаться. В этом случае вам потребуется восстановить базу данных из резервной копии или выполнить ремонт базы данных. Обратитесь к документации Moodle для получения дополнительных инструкций по восстановлению или ремонту базы данных.
  • Проблемы с соединением с базой данных: Если возникают проблемы с соединением с базой данных, то Moodle не сможет установить связь с базой данных и не запустится. Проверьте настройки соединения с базой данных в конфигурационных файлах Moodle и убедитесь, что сервер базы данных доступен и соединение установлено правильно.

Если вы столкнулись с проблемами с базой данных, рекомендуется связаться со специалистом по Moodle или провайдером хостинга, который сможет помочь вам в решении проблемы.

Недостаточные ресурсы сервера

Одной из основных причин проблем с запуском Moodle может быть недостаток ресурсов на сервере. Если сервер не обладает достаточным объемом процессора, оперативной памяти или дискового пространства, это может привести к сбоям в работе системы.

Чтобы исправить эту проблему, вам может потребоваться увеличить ресурсы сервера. Вот несколько способов:

  • Обновление серверного оборудования: Если ваш сервер устарел, попробуйте обновить его. Увеличение процессора, добавление большего количества оперативной памяти или увеличение дискового пространства могут значительно повысить производительность сервера и решить проблему.
  • Оптимизация настроек сервера: Проверьте настройки сервера и убедитесь, что они настроены оптимально. Некоторые параметры, такие как максимальный объем оперативной памяти, доступный для PHP скриптов, могут потребовать изменения.
  • Использование кэширования: Включение системы кэширования может снизить нагрузку на сервер и улучшить производительность Moodle. Например, вы можете использовать систему кэширования Redis или Memcached.

Обратитесь к администратору сервера или хостинг-провайдеру для получения подробной информации о доступных вам опциях для увеличения ресурсов сервера.

Проблемы с памятью сервера

Если вы сталкиваетесь с этой проблемой, рекомендуется выполнить следующие действия:

  1. Проверьте требования к памяти, указанные в документации по установке Moodle. Убедитесь, что ваш сервер соответствует этим требованиям.
  2. Увеличьте выделенное количество памяти на сервере. Это можно сделать путем изменения настроек сервера или виртуальной машины.
  3. Оптимизируйте использование памяти Moodle. Например, вы можете отключить или удалить ненужные плагины или модули, чтобы снизить нагрузку на память.

Если проблемы с памятью сервера остаются после применения этих мер, стоит обратиться за помощью к администратору сервера или провайдеру хостинга, чтобы получить рекомендации по настройке и увеличению доступной памяти.

Are you looking for a solution for the error message “error/moodle/generalexceptionmessage”? We can help you.

A few days ago, we had come across this error message and our Support Engineers fixed it efficiently.

Here at Bobcares, we often receive requests to fix Moodle errors as a part of our Server Management Services.

Today, let’s see the possible causes for this error and see how our Support Engineers fix this error.

Why does the exception error message show up?

We have seen this error appearing during moodle upgrade attempt, while attempting to add courses in moodle, creating a guest or admin user and many during many other occasions.

The most common causes for this error that we have seen is due to corrupt plugins, outdated moodle version, missing a few necessary PHP libraries and many more.

Among these, the most common one is the plugins that are mainly used in messaging.

Possible causes for error/moodle/generalexceptionmessage to appear

Now, let’s discuss the common causes due to which this error message appears.

1. Faulty plugins

Many of our customers enable plugins for messaging in moodle. Sometimes, these plugins won’t be compatible with the PHP version or the moodle version due to which it will throw an error message.

Hence, disabling this plugin will normally fix the error.

2. Missing PHP Libraries

We’ve seen customers experiencing this error if the necessary PHP libraries are not available on the server.

However, this can be easily found through the error message displayed in the moodle.

3. Outdated Moodle version

Sometimes, if the Moodle is not up-to-date then it will throw an error.

So it is always recommended to keep the moodle updated.

How we fix this error/moodle/generalexceptionmessage?

Our Support Engineers are well experienced in managing servers and are familiar with Moodle errors. Now, let’s see how our Support Engineers fix this error.

1. Faulty plugins

One of our customers approached us with the error message generalexceptionmessage in moodle. Here is the screenshot of the error message.

Our Support Engineers started troubleshooting this error by checking the version of Moodle.

As a result, we found that the moodle was of the latest version.

Then we went checking for any third plugins enabled for messaging if they are causing any problem.

For that, we followed the below steps:

1. Accessed the Site Administration.

2. Clicked on the Plugin and then Plugins overview option.

3. Then accessed the Additional plugins.

Here, we found that there was a third party plugin enabled. Disabling it fixed the error.

Through this, we could find that the plugin was causing the problem.

2. Missing PHP XML Library

We came across the same error message but on another occasion. One of our customers was trying to upgrade the moodle and ran into the below error message

# php moodle/admin/cli/upgrade.php
Default exception handler: Exception - Call to undefined function xml_parser_create() Debug:
Error code: generalexceptionmessage
* line 76 of /lib/xmlize.php: Error thrown
* line 307 of /lib/environmentlib.php: call to xmlize()
* line 355 of /lib/environmentlib.php: call to load_environment_xml()
* line 101 of /lib/environmentlib.php: call to get_latest_version_available()
* line 116 of /admin/cli/upgrade.php: call to check_moodle_environment()

!!! Exception - Call to undefined function xml_parser_create() !!!
!!
Error code: generalexceptionmessage !!
!! Stack trace: * line 76 of /lib/xmlize.php: Error thrown
* line 307 of /lib/environmentlib.php: call to xmlize()
* line 355 of /lib/environmentlib.php: call to load_environment_xml()
* line 101 of /lib/environmentlib.php: call to get_latest_version_available()
* line 116 of /admin/cli/upgrade.php: call to check_moodle_environment()
!!

After looking at this error message our Support Engineers found that the PHP XML library was missing.

Finally, we fixed this error by installing the XML library by running the below command:

apt-get install php7.0-xml
service apache2 restart

After this, the customer was able to upgrade the moodle.

[Need any assistance in fixing the moodle errors? – We’ll help you]

Conclusion

In short, the error/moodle/generalexceptionmessage appears due to many reasons which include faulty plugins, missing PHP libraries, outdated moodle and many more. Today, we saw how our Support Engineers fix this error.

PREVENT YOUR SERVER FROM CRASHING!

Never again lose customers to poor server speed! Let us help you.

Our server experts will monitor & maintain your server 24/7 so that it remains lightning fast and secure.

GET STARTED

var google_conversion_label = «owonCMyG5nEQ0aD71QM»;

currently we are experiencing the ‘Error Reading from Database’ issue with our Moodle site. We’ve established this is not due to a recent Upgrade and are unsure of the troubleshooting steps to take for this fix.

Can anyone advise of the troubleshooting steps we can take to resolve this issue?

  • php
  • database
  • moodle

asked Jan 9, 2017 at 23:42

Matt.M's user avatar

3

  • What version of Moodle did you upgrade from and to?

    Jan 9, 2017 at 23:45

  • Is there a Stack Trace? If so, please edit the question and add the Stack Trace.

    Jan 10, 2017 at 2:51

  • Where is your database? Is it up? Can the web server see it?

    Jan 10, 2017 at 12:17

1 Answer

This error does not tell us exactly what is going on, but you can try this:

Open the file: /lib/dml/mysqli_native_moodle_database.php and change @@default_storage_engine to @@storage_engine.

Hope that helps!

bouteillebleu's user avatar

answered Mar 23, 2017 at 13:00

caioduarte's user avatar

Понравилась статья? Поделить с друзьями:
  • Исправление ошибок microsd карты
  • Исправление ошибок json
  • Исправление ошибок hdd linux
  • Исправление ошибок far cry 4
  • Исправление ошибок gta vice city