Difference between revisions of "Installation FAQ"

Jump to: navigation, search

Note: You are currently viewing documentation for Moodle 3.2. Up-to-date documentation for the latest stable version of Moodle is probably available here: Installation FAQ.

(Added references to forum posts on increasing max. upload size)
m (See also)
 
(133 intermediate revisions by 24 users not shown)
Line 1: Line 1:
 +
{{Installing Moodle}}
 +
== System information needed for Installation problems forum ==
 +
When posting questions to the [http://moodle.org/mod/forum/view.php?id=28 Installation problems forum], try to provide as much background information as possible about your Moodle system. Consider providing some or all of the following:
 +
* Server Operating System name (version also if possible):
 +
* PHP version (e.g. PHP 5.4.4)
 +
* Database server type and version (e.g. MySQL 5.5.18)
 +
* Browser and version (e.g. Firefox, IE8):
 +
* Moodle version (e.g. 3.0):
 +
* Moodle install type? (New/Upgrade):
 +
* Moodle config.php attached (please remove passwords):
 +
* Phpinfo attached?:
 +
 +
Make sure you provide a sensible description (never HELP! or URGENT!) and a full description of what you did and what happened. Copy and paste any error messages accurately in full. 'Nothing' is not a symptom, even a blank page is something!
 +
 +
[[#top|Top]]
 +
 
==PHP - is it installed and what version do I have?==
 
==PHP - is it installed and what version do I have?==
  
 
Make a new file on your web site called ''info.php'', containing the following text, and call it from your browser:
 
Make a new file on your web site called ''info.php'', containing the following text, and call it from your browser:
  
<?PHP phpinfo() ?>
+
<code php>
 +
<?PHP phpinfo() ?>
 +
</code>
  
 
If nothing happens then you don't have PHP installed or your webserver is not configured to handle .php files properly. See the installation docs for some information about where to download it for your computer. See the [[phpinfo]] page for details about the content of this page.
 
If nothing happens then you don't have PHP installed or your webserver is not configured to handle .php files properly. See the installation docs for some information about where to download it for your computer. See the [[phpinfo]] page for details about the content of this page.
  
== System information needed for Installation problems forum ==
+
[[#top|Top]]
When posting questions to the [http://moodle.org/mod/forum/view.php?id=28 Installation problems forum], try to provide as much background information as possible about your moodle system. Use this template to copy and paste into your post:
+
 
* Server Operating System name (version also if possible):  
+
 
* Browser name (version also if possible):
+
==I am being told that I need the '''intl php plugin''' to continue to install Moodle 2.x==
* Moodle version:
+
The intl.dll from Zend is part of the PHP 5.2.8 release and later. It is aimed at improving the internationalization of php pages and Moodle 2.x uses it as part of this process. If your install is on a local machine or network, then you can download the latest version of PHP and update your PHP. You then have to uncomment all the required dynamic extensions you need, including the php_intl.dll extension. The problem is then solved. If the install is on a host server, then you need to contact your host and ask them to do the same, As an alternative, you can unzip/untar the download file, copy and paste the intl.dll file to your php/ext folder and include the line:
* Moodle install type? (New/Upgrade):
+
  extension=php_intl.dll
* Moodle config.php attached?(Y/N):
+
in the Dynamic Extensions section of your php.ini file.
* Phpinfo attached? (Y/N):
+
 
 +
You can also set the error level using:
 +
  intl.error_level = E_WARNING
 +
but this is not essential
 +
 
 +
If you are using a Linux install, use your system package manager or specify compilation flag.
 +
    * Debian 5.0 (& Ubuntu) use: apt-get install php-intl or apt-get install php5-intl
 +
    * CentOS 5.5 (& RedHat) you should (probably) be using php 5.3 from remi and then use: yum install php-intl
 +
 
 +
This technique can be applied to any updated dynamic extension from Zend. You may want to use later dll files in your php/ext folder, you can do so by doing the same as above, but be careful, your version may not be able to take full advantage of the extension, or some very new extensions may cause an unexpected instability. The best option is still to update on a regular basis, perhaps once a year or so for the PHP.
 +
 
 +
[[#top|Top]]
 +
 
 +
===What Dynamic Extensions do I really need uncommented in my php.ini file? What else do I need to change?===
 +
This assumes you have complete control over the installation and running of your server, if your Moodle is hosted, you need to do something different, which is also discussed below. In the php.ini you need to delete the semi-colon, the ;, from the start of any line to uncomment it. For Moodle, you really should only need to change some values, and make sure the extensions you require are available. These are:
 +
 
 +
Resource Limits
 +
  memory_limit = 128M    //This is the maximum it requires and on a shared server you may get much less.
 +
 
 +
Data Handling
 +
  post_max_size = 512M    //This allows postings of up to 512MB, but set it to suit yourself and your circumstances
 +
 
 +
Paths and Directories
 +
  doc_root ="driveletter:\path\to\server\active\web\directory"  (e.g. d:\Apache\htdocs or e:\iis\wwwroot )
 +
  and
 +
  extension_dir = "driveletter:\path\to\php\ext" (e.g. d:\php\ext or e:\iis\php\ext)
  
For the last two items, try to include the following in your post as an attachment:
+
File Uploads
* A copy of your phpinfo output as shown in your browser (see the instructions above for an explanation of how to obtain this, or see [[phpinfo]]).
+
  upload_max_filesize = 512M    (This is different from the post_max_size this is for file uploads.)
* A copy of the Moodle configuration file (with secret info like database password deleted, of course). This is located in the main Moodle directory (by default called moodle), and is named config.php
 
  
Copy and paste both of these into a single text file (using vi, Notepad, etc) and attach this to your post. If your PC is a Windows box and config.php looks messy (line breaks missing or in the wrong places) in Notepad, try Wordpad.
+
Dynamic Extensions ('''Windows Only''')
 +
{| class="nicetable"
 +
|-
 +
! PHP 5.3.x
 +
|-
 +
|
 +
  extension=php_curl.dll
 +
  extension=php_gd2.dll
 +
  extension=php_gettext.dll
 +
  extension=php_intl.dll
 +
  extension=php_imap.dll
 +
  extension=php_ldap.dll
 +
  extension=php_mbstring.dll
 +
  extension=php_exif.dll      ; Must be after mbstring as it depends on it
 +
  extension=php_mysql.dll
 +
  extension=php_mysqli.dll
 +
  extension=php_openssl.dll
 +
  extension=php_pdo_mssql.dll
 +
  extension=php_pdo_mysql.dll
 +
  extension=php_soap.dll
 +
  extension=php_sockets.dll
 +
  extension=php_sqlite.dll
 +
  extension=php_xmlrpc.dll
 +
  extension=php_zip.dll
 +
|}
  
If you cannot provide your phpinfo, try to copy & paste and complete these in your post:
+
These edits and Dynamic extensions cover a range of options here, there are a number of other possibilities, but these listed are the most common ones. Unless you have a specific need, there may not be any reason to deviate from these settings, but if you do, make sure you know what is going to happen. These extensions will also allow you to successfully install and run many other PHP applications.  
* Webserver (e.g. Apache/IIS) version:
 
* Database server (e.g. MySQL, PostgreSQL) version:
 
* PHP version:
 
  
For installation on web hosting accounts: contact your support desk who should be able to tell you this information.
+
One example is the Oracle extensions are not shown here, but Oracle can be used for the Moodle database. Another area people often get themselves into trouble is using "Magic quotes". Magic quotes really should be set to off, they were only introduced early in the use of PHP to allow for some inexperienced scripting practices, (read poor, shoddy or dodgy here). If someone is still writing poor scripts, then they deserve to draw attention to themselves and their scripts deleted.
  
: '''Security Warning''': Make sure you edit any files and delete any passwords before posting onto the forum.
+
[[#top|Top]]
  
 
==What & where are Moodle's configuration settings stored?==
 
==What & where are Moodle's configuration settings stored?==
Configuration settings are stored in the config.php file stored in your moodle folder. This file is created during the installation process. If there is a problem and the installation cannot create the file, you can try creating it manually from the [[Configuration file]] docs. Please remember that manually editing the file is not recommended and may lead to blank pages, especially if there are additional spaces and/or lines after the final php closing tag "?>".
+
Configuration settings are stored in the config.php file stored in your moodle folder. This file is created during the installation process. If there is a problem and the installation cannot create the file, you can try creating it manually from the [[Configuration file]] docs.  
 +
[[#top|Top]]
  
 
==Downloading previous releases of Moodle==
 
==Downloading previous releases of Moodle==
* '''Generic Packages''': If your server does not meet the [[Installing_Moodle#Requirements | requirements]] for the current version of Moodle, you can download previous releases by using wget, lynx or curl with this URL:
 
<nowiki>http://download.moodle.org/stable[version_number]</nowiki>
 
:For example: to download Moodle version 1.5, use http://download.moodle.org/stable15. You'll see a directory tree with the files displayed. Click on the one you want and download as normal - if you require the latest update of the version, scroll to the end of the list and download the "moodle-latest" file, or alternatively use these URLs for zip or tgz downloads:
 
<nowiki>http://download.moodle.org/stable[version_number]/moodle-latest-[version_number].zip</nowiki>
 
<nowiki>http://download.moodle.org/stable[version_number]/moodle-latest-[version_number].tgz</nowiki>
 
  
:Changes made in the version in the last month are listed in the "CHANGES" file in the directory listing. The files you download contain Moodle code and are not the Windows or Mac packages - so you need to have a webserver, a database server and PHP already installed. The earliest version available is Moodle 1.3.
+
Previous versions of Moodle that are not found on [http://download.moodle.org Moodle downloads] may be downloaded from <nowiki>http://download.moodle.org/stable[version_number]/</nowiki> where [version_number] is the number without a point. For example http://download.moodle.org/stable22/ or http://download.moodle.org/stable27/
* '''Windows Packages''': To download previous releases of the Moodle packages for Windows, use this URL:
 
<nowiki>http://download.moodle.org/windows/MoodleWindowsInstaller-latest-[version_number].zip</nowiki>
 
* '''Mac Packages''': To download previous releases of the Mac pacakges, use either of these URLs (depending on whether you need the Intel or PPC package):
 
<nowiki>http://download.moodle.org/macosx/Moodle4Mac-Intel-[version_number].dmg</nowiki>
 
<nowiki>http://download.moodle.org/macosx/Moodle4Mac-PPC-[version_number}.dmg</nowiki>
 
* '''Using CVS''': You can also use CVS to download older releases and incremental releases of the Moodle generic packages, e.g. Moodle 1.5.4 - see the [[CVS_for_Administrators | CVS documentation]].
 
  
== How to enable and check PHP error logs==
+
You'll see a directory tree with the files displayed. Click on the one you want and download as normal. If you require the latest update of the version, scroll to the end of the list and download the "moodle-latest" file.
PHP can be set up to log errors in a variety of different ways: two of these involve the use of the php.ini file and the ini_set command.
 
* '''Using the php.ini file''': The log settings are contained in the php.ini file stored on the server. If you don't know where that is, edit your Moodle ''config.php'' and add the following as the second line
 
  
  phpinfo();
+
* '''Windows Packages''': To download other releases not found in [http://download.moodle.org/windows/ Moodle packages for Windows], use this URL:
 +
:<nowiki>http://download.moodle.org/windows/MoodleWindowsInstaller-latest-[version_number].zip</nowiki>
 +
* '''Mac Packages''': To download other releases not found in [http://download.moodle.org/macosx/ Mac packages], use either of these URLs (depending on whether you need the Intel or PPC package):
 +
:<nowiki>http://download.moodle.org/macosx/Moodle4Mac-Intel-[version_number].dmg</nowiki>
 +
:<nowiki>http://download.moodle.org/macosx/Moodle4Mac-PPC-[version_number}.dmg</nowiki>
  
:then reload the web page. Look for the entry '''Configuration File (php.ini) Path'''.
+
For details of how to download a particular weekly version, see the post [https://moodle.org/mod/forum/discuss.php?d=346698#p1398162 Looking for VERY specific release of older Moodle].
  
:When you have located php.ini open it in your favorite text editor. Find the '''Error handling and logging''' section of the php.ini file. Make sure that both '''display_errors = On''', '''display_startup_errors = On''' and '''log_errors = On''' are present and uncommented. Check the value of '''error_log''' - this tells you the location of the file errors are logged to. If it is commented out then errors will be sent to the web server error log file. Remember, if you make any changes to this file you will need to restart the web server (or just reboot the server).
+
[[#top|Top]]
  
* '''Using ini_set commands''': If you are using Moodle 1.7 or higher, the previous steps are not enough. In those versions error logging parameters are dependant on certain administrative settings that you specify in the debugging section. The problem is that if you can't access the administrative pages, you can't set the debugging options. So the only way to modify them is by adding the following lines to your config.php file, just before the last line (the one containing a single'?>' only):
+
== How to enable and check PHP error logs==
 
+
PHP can be set up to log errors in a variety of different ways: two of these involve the use of the php.ini file and the ini_set command.  See [[dev:PHP error logs|PHP_error_logs]].
  ini_set ('display_errors', 'on');
 
  ini_set ('log_errors', 'on');
 
  ini_set ('display_startup_errors', 'on');
 
  ini_set ('error_reporting', E_ALL);
 
  $CFG->debug = DEBUG_ALL;
 
  
:This will enable the same settings specified above even if Moodle sets them otherwise.
+
== "Could not find a top level course" ==
:'''Important''': Remember to put them just before the last line of config.php.
+
If this appears immediately after you have attempted to install Moodle it almost certainly means that the installation did not complete. A complete installation will ask you for the administrator profile and to name the site just before it completes. Check your logs for errors. Then drop the database and start again. If you used the web-based installer try the command line one. Does your computer definitely have sufficient resource to run Moodle?
  
 
==Email copies are not being sent from my forums==
 
==Email copies are not being sent from my forums==
  
You ''must'' set up cron properly if you want Moodle to send out automatic email from forums, assignments etc. This same process also performs a number of clean-up tasks such as deleting old unconfirmed users, unenrolling old students and so on.
+
You ''must'' set up cron properly if you want Moodle to send out automatic email from forums, assignments etc. This same process also performs a number of clean-up tasks such as deleting old unconfirmed users, unenrolling old students and so on. Please refer to the [[Cron|cron instructions]].
  
Basically, you need to set up a process to regularly call the script <code><nowiki>http://yoursite/admin/cron.php</nowiki></code>. Please refer to the [[Cron|cron instructions]].
+
Tips:
 +
* Try the default settings in ''Settings > Site administration > Plugins > Message outputs > Email''. This generally works. Except...
 +
* On a Windows server you *must* supply the address of an SMTP server (Windows, unlike Unix, does not have a build in mail server) in the above settings page
 +
* Make sure that ''allowuseremailcharset'' in ''Settings > Site administration > Plugins > Message outputs > Email'' is set to No unless you really know what you are doing. Setting this to Yes can cause a problem in some versions of Moodle.
 +
* Check your firewall or ask your network administrator. Many mail servers are heavily locked down and you may need permission to send mail through them.
  
Tips:
+
[[#top|Top]]
* Try the default settings in ''Administration > Server > Email''. This generally works.
 
*Make sure that ''allowuseremailcharset'' in ''Administration > Server > Email'' is set to No. Setting this to Yes can cause a problem in some versions of Moodle.
 
  
 
==I can't log in - I just stay stuck on the login screen==
 
==I can't log in - I just stay stuck on the login screen==
  
The most common cause for this is that your own computer (not your Moodle server) has a firewall that is stripping referrer information from the browser. Here are some instructions for fixing [http://service1.symantec.com/SUPPORT/nip.nsf/46f26a2d6dafb0a788256bc7005c3fa3/b9b47ad7eddd343b88256c6b006a85a8?OpenDocument&src=bar_sch_nam Norton firewall products].
+
This may also apply if you are seeing  “Your session has timed out. Please login again” or "A server error that affects your login session was detected. Please login again or restart your browser" and cannot log in.
 +
 
 +
The following are possible causes and actions you can take (in no particular order):
 +
 
 +
* Check first that your main admin account (which will be a manual account) is also a problem. If your users are using an external authentication method (e.g. LDAP) that could be the problem. Isolate the fault and make sure it really is Moodle before going any further.
 +
* Check that your hard disk is not full or if your server is on shared hosting check that you have not reached your disk space quota. This will prevent new sessions being created and nobody will be able to log in.
 +
* Carefully check the permissions in your 'moodledata' area. The web server needs to be able to write to the 'sessions' subdirectory.
 +
* Your own computer (not your Moodle server) may have a firewall that is stripping referrer information from the browser. Here are some instructions for fixing [http://service1.symantec.com/SUPPORT/nip.nsf/46f26a2d6dafb0a788256bc7005c3fa3/b9b47ad7eddd343b88256c6b006a85a8?OpenDocument&src=bar_sch_nam Norton firewall products].
 +
* Try deleting the ''sessions'' folder in your moodledata directory (anybody currently logged in will be thrown out)
 +
* Try deleting cookies on your computer and/or try another browser or another client computer
 +
* In ''Settings > Site administration > Server > Session Handling'', try setting a value for 'Cookie prefix'. You can also do this by setting <code>$CFG->sessioncookie='something';</code> in config.php. This is especially true if you are using multiple Moodles on the same browser.
 +
* Make sure you have not removed or changed the [[Password salting|Password Salt]] value(s) in config.php. If passwords were created using a salt the correct salt must be in config.php for those passwords to continue to work. This is easily done if you recreate config.php while performing an upgrade and forget to transfer the salt values.
 +
* Do you have a .htaccess file in your Moodle folder (or its parent directories). If so, is there anything in there that might be causing trouble (strange redirects, access restrictions etc.)?
 +
* Check the value of '''mnet_localhost_id''' in the mdl_config database table. It's normally 1 but must match the '''mnet_hostid''' field in your user records in the mdl_user table for the user to be recognised. It can sometimes get changed spuriously during upgrades or site migrations.
 +
* Check config.php - it should NOT have any spaces/new lines at the end of code.
 +
* You are using the correct username and password, yes?
  
Another possible cause of this problem is that sessions are not configured properly on the server. You can test this by calling the script <nowiki>http://yourserver/moodle/lib/session-test.php</nowiki>.
+
If you are still having problems, read the [[Can_not_log_in | Cannot log in]] page. You '''could''' also try changing the admin password. Proceed as if you have lost it - see [[Administration FAQ]].
  
If you are still having problems, read the [[Can_not_log_in | Cannot log in]] page.
+
[[#top|Top]]
  
 
==I log in but the login link doesn't change. I am logged in and can navigate freely.==
 
==I log in but the login link doesn't change. I am logged in and can navigate freely.==
Line 92: Line 159:
 
Make sure the URL in your <code>$CFG->wwwroot</code> setting is exactly the same as the one you are actually using to access the site.
 
Make sure the URL in your <code>$CFG->wwwroot</code> setting is exactly the same as the one you are actually using to access the site.
  
 +
[[#top|Top]]
 
==Uploaded files give "File not found"==
 
==Uploaded files give "File not found"==
  
 
For example: Not Found: The requested URL /moodle/file.php/2/myfile.jpg was not found on this server.
 
For example: Not Found: The requested URL /moodle/file.php/2/myfile.jpg was not found on this server.
  
Your web server needs to be configured to allow the part of the URL after a script name to be passed directly to the script. This is usually enabled in Apache 1, but is usually disabled by default in Apache 2. To turn it on, add this line to your ''httpd.conf'', or to a ''.htaccess'' file in your local directory (see [[Installing Moodle]] for more details):
+
This indicates that slash arguments are not enabled on your web server. Please see [[Using slash arguments]] for details.
  
'''AcceptPathInfo''' on
+
[[#top|Top]]
  
Note, this will ONLY work for Apache versions 2.x.
+
==Why are all my pages blank?==
 
 
If you are not using Apache 2 and you still have this problem (unlikely) then you can switch Moodle to use an alternative method. The disadvantages are a slight loss of performance for your users and you won't be able to use relative links within HTML resources.
 
 
 
To use this alternative method, you should change the ''slasharguments'' variable. For moodle versions < 1.7, this is located in the Operating System section of ''Administration > Configuration > [[admin/config|Variables]]''. In later versions, this option is located in ''Site Administration > Server > HTTP''. You should now be able to access your uploaded files.
 
  
==Why are all my pages blank?==
+
Check the dirroot variable in ''config.php''. You must use complete, absolute pathnames (e.g.)
  
Check the dirroot variable in ''config.php''. You must use complete, absolute pathnames e.g.
+
<code php>
 +
$CFG->dirroot = "/var/www/moodle";
 +
</code>
  
$CFG->dirroot = "d:\inetpub\sites\www.yoursite.com\web\moodle";
+
Another reason might be that PHP has not been configured to support MySQL (or whatever other database you are using). This is common on RedHat and OpenBSD installations. In this case, an error is generated, but since error displays are often disabled by default, all that is seen on the browser is a blank screen. To enable PHP error displays see [[Installation_FAQ#How_to_enable_and_check_PHP_error_logs | How to enable and check PHP error logs]].
  
Another reason might be that PHP has not been configured to support MySQL. This is common on Redhat and OpenBSD installations. In this case, an error is generated, but since error displays are often disabled by default, all that is seen on the browser is a blank screen. To enable PHP error displays see [[Installation_FAQ#How_to_enable_and_check_PHP_error_logs | How to enable and check PHP error logs]].
+
To determine if database support is your problem, insert this as the second line in your ''config.php'' file
  
To determine if MySQL support is your problem, insert this as the second line in your ''config.php'' file
+
<code php>
 +
phpinfo();
 +
</code>
  
phpinfo();
+
then reload the web page. Examine the output closely to see if you chosen database is supported. If not, look for a package you are missing.
  
then reload the web page. Examine the output closely to see if MySQL is supported. If not look for a package you are missing.
+
[[#top|Top]]
  
 
== Why is a particular page blank or incomplete? ==
 
== Why is a particular page blank or incomplete? ==
  
 
*'''Check your web server log files!!'''  
 
*'''Check your web server log files!!'''  
:If a particular page is blank or incomplete (it doesn't display the footer), before you do anything else [[Installation_FAQ#How_to_enable_and_check_PHP_error_logs | check your error logs]]. Having established that PHP error logging is working, reproduce the error. Immediately check the error log file right at the end. Hopefully you will see a PHP error message at or very near the end of the file. This may solve your problem directly or makes it a lot easier to diagnose the problem in the Moodle forums.
+
:If a particular page is blank or incomplete (it doesn't display the footer), before you do anything else switch on [[Debugging]] and  [[Installation_FAQ#How_to_enable_and_check_PHP_error_logs | check your PHP error logs]]. Having established that PHP error logging is working, reproduce the error. Immediately check the error log file right at the end. Hopefully you will see a PHP error message at or very near the end of the file. This may solve your problem directly or makes it a lot easier to diagnose the problem in the Moodle forums.
  
*If you are '''upgrading to a new version of Moodle''', check that you do not have an old version of a non-standard block or module installed. Remove any such blocks or modules installed using the admin settings page and start the install process again. However, do also make sure that you have included all optional plugins that were required by your courses.  
+
*If you are '''upgrading to a new version of Moodle''', check that you do not have an old version of a non-standard block or module installed. Remove any such blocks or modules installed using the admin settings page and start the install process again. However, do also make sure that you have included all optional plugins that were required by your courses. This is particularly common with "editing on".
  
 
*If you '''do not see any blocks listed''', turn editing on and remove any blocks that you have added to that page and try reloading.
 
*If you '''do not see any blocks listed''', turn editing on and remove any blocks that you have added to that page and try reloading.
Line 132: Line 200:
  
 
'''See also''':
 
'''See also''':
*Using Moodle [http://moodle.org/mod/forum/discuss.php?d=97734 PHP configuration error] forum discussion
+
*Using Moodle [http://moodle.org/mod/forum/discuss.php?d=97734 PHP configuration error] forum discussion
  
 
==Installation hangs when setting-up database tables==
 
==Installation hangs when setting-up database tables==
Sometimes the installation will hang when setting up tables. This will be an abrupt hang with half the page displayed in the browser and/or other outputs removed. Examples are:
+
Sometimes the installation will hang when setting up tables, where only half the page displayed in the browser and/or other outputs are removed. You may see truncated MySQL statements, or the “Scroll to continue” link is displayed but no “Continue” button is there.  
 
 
- '''Truncated MySQL statements''':
 
 
(mysql): SET NAMES 'utf8'
 
--------------------------------------------------------------------------------
 
(mysql): SHOW LOCAL VARIABLES LIKE 'character_set_database'
 
...
 
...
 
(no more statements are displayed) 
 
 
 
- '''Missing Continue button''': The “Scroll to continue” link is displayed but no “Continue” button is there.  
 
 
 
'''Note''': There is an exception to this when upgrading an existing database and the installation may appear to hang at the roles generation phase. This process can take a very long time - so please be patient.
 
 
 
Below are some solutions you can try to overcome this problem:
 
  
*'''Check for MySQL limits'''. This is often a MySQL error and not a php error. Check that there is no limit placed on your mysql database, e.g. a "questions" limit. See [http://dev.mysql.com/doc/refman/5.0/en/user-resources.html Limiting Account Resources in the MySQL manual].
+
See [[Unexpected installation halts]] for more about solutions that involve:
 +
*Checking for MySQL limits
 +
*Checking the .htaccess files
 +
*Code customizations issues
 +
*Checking memory limit  
 +
*Upgrade incrementally
 +
*Fix fopen function
  
*'''Check your .htaccess files'''. If the install is on a webhost, adding the following line to the .htaccess file in the Moodle directory has been known to solve the problem.
+
[[#top|Top]]
AddType x-mapp-php5 .php
 
 
 
:Try also renaming the .htaccess file so that it is disabled.
 
 
 
*'''Code customizations'''. You may also want to look and see if you've customized any of your code.  Look at the last successful table, and then look at the block, mod, or other code that is referenced by that table.  For example, if your install hangs and continues to say that the forum tables were successful as the last message, look at /mod/forum/ for any custom code.  If you have customized code, backup those files and replace with the correct files.  You can then restart the install by renaming config.php or reinstalling your database from the backup.  If your install is successful, you can make your code changes back into the stock Moodle code.
 
 
 
*'''Check your memory limit'''. It may also be that the "memory_limit" in your php.ini is set too low. Please check your php.ini file and allocate the recommended amount (see [https://docs.moodle.org/en/Installing_Moodle#Requirements Moodle requirements]). For Moodle version 1.8 and above at least 40MB is  recommended.
 
 
 
*'''Upgrade incrementally'''. To avoid this problem when upgrading, it is recommended to upgrade via each version of Moodle, for example 1.7 -> 1.8 -> 1.9 (with the exception of upgrading from 1.5 or 1.6, when it is recommended that 1.7 be skipped, in other words upgrade 1.5 -> 1.6 -> 1.8 -> 1.9).
 
 
 
A work-around to this problem is to setup a working Moodle system on your local PC or server using the [http://download.moodle.org Moodle Packages]. Once you have a running Moodle, [https://docs.moodle.org/en/Upgrading_Moodle#Backup_important_data backup the database] and import to your webhost. Then backup the Moodle code itself (the "moodle" directory on your PC) and copy this to your webhost using (for example) FTP. Finally, edit the moodle/config.php file for the new settings that have to be changed for the webhost.
 
 
 
Some Moodlers have found the suggestion in http://moodle.org/mod/forum/discuss.php?d=65786#p297433 helpful, for some unknown reason. It claims that it is because the fopen function in the line (now line 426 instead of 406) was not being given a string as the first argument, but that's not true. It was a string; after the edit it is a string whose first and last characters are single quote marks. The amazing thing is that it works at all after that edit. What's even more amazing is that it fixes the problem, at least for some users. Go figure.
 
  
 
==Why can't I upload a new image into my profile?==
 
==Why can't I upload a new image into my profile?==
  
If you don't see anything on your user profile pages to let you upload user images then it's usually because GD is not enabled on your server. GD is a library that allows image processing.
+
If you don't see anything on your user profile pages to let you upload user images then it's usually one of the following:
 
+
*The permissions associated with the role you are using are preventing you from changing your profile picture.
1. Make sure '''GD has been included in your PHP installation'''. You can check this by going into Administration >> Configuration >> [[Variables]] and looking for the gdversion setting. This setting is chosen automatically every time you visit that page. If it shows GD version 1 or version 2 then everything should be fine. Save that configuration page and go back to your user profile.
+
* GD is not installed, or is not enabled on your server. Make sure '''GD has been included in your PHP installation'''. You can check this by going to ''Site Administration > Server > PHP info'' and looking for the gdversion setting. This setting is chosen automatically every time you visit that page. If it shows GD version 1 or version 2 then everything should be fine. Save that configuration page and go back to your user profile.
 +
* GD is installed, but is in some way corrupt. For instance, [http://moodle.org/mod/forum/discuss.php?d=44271#p386194 see this discussion on empty lines or white spaces in config files.]
 +
GD is a library that allows image processing. For example, when all is well with your system, and you upload a new profile image, GD compresses the image and produces two thumbnails, one is 100x100 pixels, and the other is 35x35 pixels.
  
2. If Moodle thinks GD is not installed, then you will need to '''install the GD library'''.  
+
If Moodle thinks GD is not installed, then you will need to '''install the GD library'''.  
 
*On Unix you may need to re-compile PHP with arguments something like this:
 
*On Unix you may need to re-compile PHP with arguments something like this:
  
Line 194: Line 242:
 
== Why doesn't my Moodle site display the time and date correctly? ==
 
== Why doesn't my Moodle site display the time and date correctly? ==
  
Each language requires a specific language code (called a '''locale''' code) to allow dates to be displayed correctly. The language packs contain default standard codes, but sometimes these don't work on Windows servers.
+
Please check the timezone settings in settings in ''Administration > Site administration > Location > Location settings''.
  
You can find the correct locale codes for Windows on these two pages: [http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vclib/html/_crt_language_strings.asp Language codes] and [http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vclib/html/_crt_country_strings.asp Country/region] codes (e.g. "esp_esp" for spanish)
+
== How do I uninstall Moodle?==
 
 
These new locale codes can be entered on the Administration >> Configuration >> [[admin/config|Variables]] page, where they override the ones in the currently chosen language pack.
 
 
 
==How do I uninstall Moodle?==
 
'''Moodle package installation''': If you have downloaded a Moodle package, simply uninstall using your system commands. On Windows PCs, you should access the Control Panel -> Add/Remove Programs. Select the package name and click Change or Remove Programs.
 
  
 
'''Webhost/manual installation''': If you have installed Moodle manually or have installed onto a webhost, follow these steps:
 
'''Webhost/manual installation''': If you have installed Moodle manually or have installed onto a webhost, follow these steps:
Line 210: Line 253:
 
*Delete the moodle directory itself. This will delete all of the moodle PHP script files.
 
*Delete the moodle directory itself. This will delete all of the moodle PHP script files.
  
==How do I upgrade Moodle? Do I just overwrite the files?==
+
'''XAMPP windows installation''': If you have installed Moodle on windows through the XAMPP package, follow these steps:
Do not overwrite files, it may cause strange errors. You should read the [[Upgrade]] documentation before proceeding.
+
*Open cmd.exe and navigate to this directory within your installation directory:
 +
<pre>server/mysql/bin</pre>
 +
*Run this command, replacing USERNAME with your database username (the default is "root") and DATABASE with your database name (the default is "moodle"):
 +
<pre>mysqladmin.exe -u USERNAME -p drop DATABASE</pre>
 +
*Enter your database password at the prompt (the default is "" [blank]).
 +
*Enter "y" to confirm the database drop.
 +
*Delete the moodledata directory. If you, or your users, have uploaded materials into this directory take a copy of these before deleting this directory.
 +
*Delete the moodle directory itself. This will delete all of the moodle PHP script files.
  
==I obtain the message "Upgrade already running in this session, please wait!"==
+
==Migrating Moodle to a new site or server==
 
+
Migrating Moodle means that you have to move the current installation to a new server, and so may have to change IP addresses or DNS entries. To do this you will need to change the $CFG->wwwroot value in the config.php on the new server. You will also have to change any absolute links stored in the database backup file (before restoring the file on the new server) either using the [[Search and replace tool]], your text editor or another "search and replace" tool, e.g. sed. For more details see the [[Moodle_migration | Moodle Migration]] page.
Most likely you refreshed the page before the completion message. If you are absolutely sure that there are no upgrade processes active (php and/or mysql), you can click on "!!!" and restart the upgrade.
 
 
 
:''Note'': If you click on "'!!!" or try to restart the upgrade from another browser, there is a chance that your data in the database could be corrupted. If this happens, you will need to restore the database from sql dump and then restart the upgrade and wait - the process can take several hours on large sites.
 
  
==Migrating Moodle to a new site or server==
+
[[#top|Top]]
Migrating Moodle means that you have to move the current installation to a new server, and so may have to change IP addresses or DNS entries. To do this you will need to change the $CFG->wwwroot value in the config.php on the new server. You will also have to change any absolute links stored in the database backup file (before restoring the file on the new server) either using the admin/replace.php script, your text editor or another "search and replace" tool, e.g. sed. For more details see the [[Moodle_migration | Moodle Migration]] page.
 
  
 
==Why does my new installation display correctly on the server, but when I view it from a different machine, styles and images are missing?==
 
==Why does my new installation display correctly on the server, but when I view it from a different machine, styles and images are missing?==
Line 228: Line 274:
 
*Finally, if you want to test your new installation across the internet, you will have to use either a domain name or a permanent (public) ip address/moodle as your web root. To handle both types of access, see [https://docs.moodle.org/en/masquerading masquerading].
 
*Finally, if you want to test your new installation across the internet, you will have to use either a domain name or a permanent (public) ip address/moodle as your web root. To handle both types of access, see [https://docs.moodle.org/en/masquerading masquerading].
  
 +
[[#top|Top]]
 
==Maximum upload file size - how to change it?==
 
==Maximum upload file size - how to change it?==
 
There are several places to change the maximum file upload size. The first place to check is the Administration block.  Security -> Site Policies -> and look for "Maximum Uploaded File Size".  This is the "maxbyte" variable found in older versions of Moodle (under Admin > Variables). Teachers may also set the maximum file size by the [[Course_settings#Maximum_upload_size|course administration block]].
 
There are several places to change the maximum file upload size. The first place to check is the Administration block.  Security -> Site Policies -> and look for "Maximum Uploaded File Size".  This is the "maxbyte" variable found in older versions of Moodle (under Admin > Variables). Teachers may also set the maximum file size by the [[Course_settings#Maximum_upload_size|course administration block]].
  
The second place to check are the server files. The php.ini file has a limit which will override any other setting. (Hint: remember to restart your server for changes to take effect)For more help see:
+
If the above does not provide a large enough figure you will need to make changes in your server settings. The usual place is in your php.ini file (go to Site administration > Server > PHPinfo and check a few lines down for its location). Look for settings '''upload_max_filesize''' and '''post_max_size''', setting them both to your desired new value (e.g. '64MB'). You will need to restart the web server for these changes to take effect - e.g. on Linux, '''/etc/init.d/apache2 force-reload'''. Check your documentation or just reboot the server. [http://nginx.org/en/docs/http/ngx_http_core_module.html#client_max_body_size NGINX] system administrators should also add client_max_body_size=XXX to the "http" section of their nginx main configuration file. ([https://rtcamp.com/tutorials/php/increase-file-upload-size-limit/#change-in-nginx-config see more info])
 +
 
 +
For more help see:
 
*[[Administration_FAQ#How_do_the_limits_on_uploaded_files_work.3F]]
 
*[[Administration_FAQ#How_do_the_limits_on_uploaded_files_work.3F]]
 
*[[Installing_Moodle#Recheck_PHP_settings]]
 
*[[Installing_Moodle#Recheck_PHP_settings]]
Line 238: Line 287:
 
*These forum posts: http://moodle.org/mod/forum/discuss.php?d=63840#287960 and http://moodle.org/mod/forum/discuss.php?d=93882#p414650
 
*These forum posts: http://moodle.org/mod/forum/discuss.php?d=63840#287960 and http://moodle.org/mod/forum/discuss.php?d=93882#p414650
  
 +
[[#top|Top]]
 +
 +
==Moodle claims PHP float handling is not compatible==
 +
 +
The symptom is that when you try to install or upgrade your Moodle, you get a message "Detected unexpected problem in handling of PHP float numbers".
 +
 +
[http://moodle.org/mod/forum/discuss.php?d=114945 This forum thread] and MDL-18253 have more information. In short, this problem should not happen, you can help us by telling posting information about exactly which version of PHP, and OS you are using. That may let us find a way to work around this problem.
 +
 +
You may be able to solve this issue by installing a more recent PHP versions. If you compile PHP yourself from source, changing the compilation options may help. However, since we don't understand the cause, we don't really know. If you do find a solution that works for you, please do tell us about it.
 +
 +
Update: we have a guess that the problem may be the [http://au2.php.net/manual/en/ini.core.php#ini.precision 'precision' setting in your php.ini file]. In a default PHP install this is set of 14. On at least one server that exhibited this problem it had been changed to a smaller value. So, if you see this problem, please try adding
 +
ini_set('precision', 14);
 +
to your config.php file, and report your success in MDL-18253.
 +
 +
==When upgrading Moodle claims my MySQL database is not UTF8 when I'm sure it is==
 +
 +
The UTF-8 detection for MySQL databases was finally fixed in Moodle 2.5, some incorrectly configured databases were previously reported as compatible.
 +
 +
Please note it is not enough to alter the charset and collation of the database, you must fix each text column in each database table!
 +
 +
Before going any further make sure you understand the difference between character encoding (how text is stored) and collations (the rules for comparing text strings). Collation problems will never cause this error but have a bunch of problems of their own.
 +
 +
See [[Converting your MySQL database to UTF8]]
 +
 +
[[#top|Top]]
 +
 +
== How do I run multiple instances of Moodle without duplicating base code? ==
 +
 +
See [http://moodle.org/mod/forum/discuss.php?d=13211 this thread] for a detailed explanation by [[User:Martin_Langhoff| Martin Langhoff]].
 +
 +
== What is FreeTDS and how can I use it in my installation? ==
 +
[[Installing MSSQL for PHP|FreeTDS]] is an open source implementation of the Tabular Data Stream protocol used by Microsoft SQL Server and Sybase for their databases. Unfortunately, Microsoft servers don't usually accept TDS 5.0 connections. FreeTDS allows your Unix/Linux applications to talk to these other database products and import and export data between different systems successfully.
 +
 +
== How do I install a plugin? ==
 +
 +
Please see [[Installing plugins]].
  
==How do I install Moodle on Windows Vista?==
+
==I can't enable a plugin on the Plugins overview page because the icon is not clickable==
 +
The open and closed eye icon on the Plugins overview page is simply there to show whether or not a plugin is enabled. You can't edit plugins from this screen. If you wish to enable a plugin, to to the appropriate page for managing the type of plugin you need, for instance ''Settings>Site administration>Plugins>Repositories>Manage repositories'' or ''Settings>Site administration>Plugins>Activity modules>Manage activities.''
  
See [[Installing Moodle on Windows Vista]].
+
== See also ==
  
==See also==
+
* [[Errors FAQ]]
 +
* [http://moodle.org/mod/forum/view.php?id=28 Installing and upgrading help forum] on moodle.org
 +
* [[Beginning_Moodle_2.0_Administration|Beginning Moodle 2.0 Administration FAQ]]
 +
Once your site is installed use these movies to inform your initial site setup;
 +
* [https://youtu.be/6b4bPmScegw MoodleBites for Administrators - Site setup part 1] YouTube movie
 +
* [https://youtu.be/XiHWJEJG8Ow MoodleBites for Administrators - Site setup part 2] YouTube movie
  
*[[Errors FAQ]]
+
Installing Moodle in a shared web hosting environment:
*Using Moodle [http://moodle.org/mod/forum/view.php?id=28 Installation problems forum]
+
* [[Finding_and_Selecting_A_Web_Host|Finding and Selecting a web host]]
  
 
[[Category:FAQ]]
 
[[Category:FAQ]]
[[Category:Installation]]
 
  
 
[[es:FAQ Instalación]]
 
[[es:FAQ Instalación]]
 
[[fr:FAQ d'installation]]
 
[[fr:FAQ d'installation]]
[[nl:Installatie FAQ]]
 
 
[[ja:インストールFAQ]]
 
[[ja:インストールFAQ]]
[[ru:Установка FAQ]]
+
[[de:Installation FAQ]]
[[pl:Instalacja FAQ]]
 

Latest revision as of 01:45, 4 April 2017

Contents

System information needed for Installation problems forum

When posting questions to the Installation problems forum, try to provide as much background information as possible about your Moodle system. Consider providing some or all of the following:

  • Server Operating System name (version also if possible):
  • PHP version (e.g. PHP 5.4.4)
  • Database server type and version (e.g. MySQL 5.5.18)
  • Browser and version (e.g. Firefox, IE8):
  • Moodle version (e.g. 3.0):
  • Moodle install type? (New/Upgrade):
  • Moodle config.php attached (please remove passwords):
  • Phpinfo attached?:

Make sure you provide a sensible description (never HELP! or URGENT!) and a full description of what you did and what happened. Copy and paste any error messages accurately in full. 'Nothing' is not a symptom, even a blank page is something!

Top

PHP - is it installed and what version do I have?

Make a new file on your web site called info.php, containing the following text, and call it from your browser:

<?PHP phpinfo() ?>

If nothing happens then you don't have PHP installed or your webserver is not configured to handle .php files properly. See the installation docs for some information about where to download it for your computer. See the phpinfo page for details about the content of this page.

Top


I am being told that I need the intl php plugin to continue to install Moodle 2.x

The intl.dll from Zend is part of the PHP 5.2.8 release and later. It is aimed at improving the internationalization of php pages and Moodle 2.x uses it as part of this process. If your install is on a local machine or network, then you can download the latest version of PHP and update your PHP. You then have to uncomment all the required dynamic extensions you need, including the php_intl.dll extension. The problem is then solved. If the install is on a host server, then you need to contact your host and ask them to do the same, As an alternative, you can unzip/untar the download file, copy and paste the intl.dll file to your php/ext folder and include the line:

 extension=php_intl.dll

in the Dynamic Extensions section of your php.ini file.

You can also set the error level using:

 intl.error_level = E_WARNING 

but this is not essential

If you are using a Linux install, use your system package manager or specify compilation flag.

   * Debian 5.0 (& Ubuntu) use: apt-get install php-intl or apt-get install php5-intl 
   * CentOS 5.5 (& RedHat) you should (probably) be using php 5.3 from remi and then use: yum install php-intl

This technique can be applied to any updated dynamic extension from Zend. You may want to use later dll files in your php/ext folder, you can do so by doing the same as above, but be careful, your version may not be able to take full advantage of the extension, or some very new extensions may cause an unexpected instability. The best option is still to update on a regular basis, perhaps once a year or so for the PHP.

Top

What Dynamic Extensions do I really need uncommented in my php.ini file? What else do I need to change?

This assumes you have complete control over the installation and running of your server, if your Moodle is hosted, you need to do something different, which is also discussed below. In the php.ini you need to delete the semi-colon, the ;, from the start of any line to uncomment it. For Moodle, you really should only need to change some values, and make sure the extensions you require are available. These are:

Resource Limits

 memory_limit = 128M     //This is the maximum it requires and on a shared server you may get much less. 

Data Handling

 post_max_size = 512M    //This allows postings of up to 512MB, but set it to suit yourself and your circumstances

Paths and Directories

 doc_root ="driveletter:\path\to\server\active\web\directory"  (e.g. d:\Apache\htdocs or e:\iis\wwwroot )
 and
 extension_dir = "driveletter:\path\to\php\ext" (e.g. d:\php\ext or e:\iis\php\ext)

File Uploads

 upload_max_filesize = 512M    (This is different from the post_max_size this is for file uploads.)

Dynamic Extensions (Windows Only)

PHP 5.3.x
 extension=php_curl.dll
 extension=php_gd2.dll
 extension=php_gettext.dll
 extension=php_intl.dll
 extension=php_imap.dll
 extension=php_ldap.dll
 extension=php_mbstring.dll
 extension=php_exif.dll      ; Must be after mbstring as it depends on it
 extension=php_mysql.dll
 extension=php_mysqli.dll
 extension=php_openssl.dll
 extension=php_pdo_mssql.dll
 extension=php_pdo_mysql.dll
 extension=php_soap.dll
 extension=php_sockets.dll
 extension=php_sqlite.dll
 extension=php_xmlrpc.dll
 extension=php_zip.dll

These edits and Dynamic extensions cover a range of options here, there are a number of other possibilities, but these listed are the most common ones. Unless you have a specific need, there may not be any reason to deviate from these settings, but if you do, make sure you know what is going to happen. These extensions will also allow you to successfully install and run many other PHP applications.

One example is the Oracle extensions are not shown here, but Oracle can be used for the Moodle database. Another area people often get themselves into trouble is using "Magic quotes". Magic quotes really should be set to off, they were only introduced early in the use of PHP to allow for some inexperienced scripting practices, (read poor, shoddy or dodgy here). If someone is still writing poor scripts, then they deserve to draw attention to themselves and their scripts deleted.

Top

What & where are Moodle's configuration settings stored?

Configuration settings are stored in the config.php file stored in your moodle folder. This file is created during the installation process. If there is a problem and the installation cannot create the file, you can try creating it manually from the Configuration file docs. Top

Downloading previous releases of Moodle

Previous versions of Moodle that are not found on Moodle downloads may be downloaded from http://download.moodle.org/stable[version_number]/ where [version_number] is the number without a point. For example http://download.moodle.org/stable22/ or http://download.moodle.org/stable27/

You'll see a directory tree with the files displayed. Click on the one you want and download as normal. If you require the latest update of the version, scroll to the end of the list and download the "moodle-latest" file.

http://download.moodle.org/windows/MoodleWindowsInstaller-latest-[version_number].zip
  • Mac Packages: To download other releases not found in Mac packages, use either of these URLs (depending on whether you need the Intel or PPC package):
http://download.moodle.org/macosx/Moodle4Mac-Intel-[version_number].dmg
http://download.moodle.org/macosx/Moodle4Mac-PPC-[version_number}.dmg

For details of how to download a particular weekly version, see the post Looking for VERY specific release of older Moodle.

Top

How to enable and check PHP error logs

PHP can be set up to log errors in a variety of different ways: two of these involve the use of the php.ini file and the ini_set command. See PHP_error_logs.

"Could not find a top level course"

If this appears immediately after you have attempted to install Moodle it almost certainly means that the installation did not complete. A complete installation will ask you for the administrator profile and to name the site just before it completes. Check your logs for errors. Then drop the database and start again. If you used the web-based installer try the command line one. Does your computer definitely have sufficient resource to run Moodle?

Email copies are not being sent from my forums

You must set up cron properly if you want Moodle to send out automatic email from forums, assignments etc. This same process also performs a number of clean-up tasks such as deleting old unconfirmed users, unenrolling old students and so on. Please refer to the cron instructions.

Tips:

  • Try the default settings in Settings > Site administration > Plugins > Message outputs > Email. This generally works. Except...
  • On a Windows server you *must* supply the address of an SMTP server (Windows, unlike Unix, does not have a build in mail server) in the above settings page
  • Make sure that allowuseremailcharset in Settings > Site administration > Plugins > Message outputs > Email is set to No unless you really know what you are doing. Setting this to Yes can cause a problem in some versions of Moodle.
  • Check your firewall or ask your network administrator. Many mail servers are heavily locked down and you may need permission to send mail through them.

Top

I can't log in - I just stay stuck on the login screen

This may also apply if you are seeing “Your session has timed out. Please login again” or "A server error that affects your login session was detected. Please login again or restart your browser" and cannot log in.

The following are possible causes and actions you can take (in no particular order):

  • Check first that your main admin account (which will be a manual account) is also a problem. If your users are using an external authentication method (e.g. LDAP) that could be the problem. Isolate the fault and make sure it really is Moodle before going any further.
  • Check that your hard disk is not full or if your server is on shared hosting check that you have not reached your disk space quota. This will prevent new sessions being created and nobody will be able to log in.
  • Carefully check the permissions in your 'moodledata' area. The web server needs to be able to write to the 'sessions' subdirectory.
  • Your own computer (not your Moodle server) may have a firewall that is stripping referrer information from the browser. Here are some instructions for fixing Norton firewall products.
  • Try deleting the sessions folder in your moodledata directory (anybody currently logged in will be thrown out)
  • Try deleting cookies on your computer and/or try another browser or another client computer
  • In Settings > Site administration > Server > Session Handling, try setting a value for 'Cookie prefix'. You can also do this by setting
    $CFG->sessioncookie='something';
    in config.php. This is especially true if you are using multiple Moodles on the same browser.
  • Make sure you have not removed or changed the Password Salt value(s) in config.php. If passwords were created using a salt the correct salt must be in config.php for those passwords to continue to work. This is easily done if you recreate config.php while performing an upgrade and forget to transfer the salt values.
  • Do you have a .htaccess file in your Moodle folder (or its parent directories). If so, is there anything in there that might be causing trouble (strange redirects, access restrictions etc.)?
  • Check the value of mnet_localhost_id in the mdl_config database table. It's normally 1 but must match the mnet_hostid field in your user records in the mdl_user table for the user to be recognised. It can sometimes get changed spuriously during upgrades or site migrations.
  • Check config.php - it should NOT have any spaces/new lines at the end of code.
  • You are using the correct username and password, yes?

If you are still having problems, read the Cannot log in page. You could also try changing the admin password. Proceed as if you have lost it - see Administration FAQ.

Top

I log in but the login link doesn't change. I am logged in and can navigate freely.

Make sure the URL in your
$CFG->wwwroot
setting is exactly the same as the one you are actually using to access the site.

Top

Uploaded files give "File not found"

For example: Not Found: The requested URL /moodle/file.php/2/myfile.jpg was not found on this server.

This indicates that slash arguments are not enabled on your web server. Please see Using slash arguments for details.

Top

Why are all my pages blank?

Check the dirroot variable in config.php. You must use complete, absolute pathnames (e.g.)

$CFG->dirroot = "/var/www/moodle";

Another reason might be that PHP has not been configured to support MySQL (or whatever other database you are using). This is common on RedHat and OpenBSD installations. In this case, an error is generated, but since error displays are often disabled by default, all that is seen on the browser is a blank screen. To enable PHP error displays see How to enable and check PHP error logs.

To determine if database support is your problem, insert this as the second line in your config.php file

phpinfo();

then reload the web page. Examine the output closely to see if you chosen database is supported. If not, look for a package you are missing.

Top

Why is a particular page blank or incomplete?

  • Check your web server log files!!
If a particular page is blank or incomplete (it doesn't display the footer), before you do anything else switch on Debugging and check your PHP error logs. Having established that PHP error logging is working, reproduce the error. Immediately check the error log file right at the end. Hopefully you will see a PHP error message at or very near the end of the file. This may solve your problem directly or makes it a lot easier to diagnose the problem in the Moodle forums.
  • If you are upgrading to a new version of Moodle, check that you do not have an old version of a non-standard block or module installed. Remove any such blocks or modules installed using the admin settings page and start the install process again. However, do also make sure that you have included all optional plugins that were required by your courses. This is particularly common with "editing on".
  • If you do not see any blocks listed, turn editing on and remove any blocks that you have added to that page and try reloading.
  • You may get this error immediately after selecting a language. At this stage of the installation process your Moodle computer may need to connect to the Internet and download a language pack, so check that the computer can access the Internet by using a browser. Check also that your PHP settings are as given in the Moodle Moodle Requirements page.

See also:

Installation hangs when setting-up database tables

Sometimes the installation will hang when setting up tables, where only half the page displayed in the browser and/or other outputs are removed. You may see truncated MySQL statements, or the “Scroll to continue” link is displayed but no “Continue” button is there.

See Unexpected installation halts for more about solutions that involve:

  • Checking for MySQL limits
  • Checking the .htaccess files
  • Code customizations issues
  • Checking memory limit
  • Upgrade incrementally
  • Fix fopen function

Top

Why can't I upload a new image into my profile?

If you don't see anything on your user profile pages to let you upload user images then it's usually one of the following:

  • The permissions associated with the role you are using are preventing you from changing your profile picture.
  • GD is not installed, or is not enabled on your server. Make sure GD has been included in your PHP installation. You can check this by going to Site Administration > Server > PHP info and looking for the gdversion setting. This setting is chosen automatically every time you visit that page. If it shows GD version 1 or version 2 then everything should be fine. Save that configuration page and go back to your user profile.
  • GD is installed, but is in some way corrupt. For instance, see this discussion on empty lines or white spaces in config files.

GD is a library that allows image processing. For example, when all is well with your system, and you upload a new profile image, GD compresses the image and produces two thumbnails, one is 100x100 pixels, and the other is 35x35 pixels.

If Moodle thinks GD is not installed, then you will need to install the GD library.

  • On Unix you may need to re-compile PHP with arguments something like this:
./configure --with-apxs=/usr/local/apache/bin/apxs --with-xml --with-gd 
--with-jpeg-dir=/usr/local --with-png-dir=/usr --with-ttf --enable-gd-native-ttf 
--enable-magic-quotes --with-mysql --enable-sockets --enable-track-vars 
--enable-versioning --with-zlib
  • On Windows this is usually a matter of "turning on" the extension in PHP by editing your php.ini file. To do this remove the semicolon for the php_gd2.dll extension - check that this file is actually present in your php extensions folder first (search your php.ini for extension_dir to determine where this points to on your hard disk). You should then have a line that looks like this:
extension=php_gd2.dll
Windows users should see the installation instructions for further help.

3. Remember to restart your webserver (if possible) and re-visit the Moodle configuration page after making any changes to PHP so it can pick up the correct version of GD.

See also: Using Moodle forum discussion Profile pictures for additional information.

Why doesn't my Moodle site display the time and date correctly?

Please check the timezone settings in settings in Administration > Site administration > Location > Location settings.

How do I uninstall Moodle?

Webhost/manual installation: If you have installed Moodle manually or have installed onto a webhost, follow these steps:

  • Delete the moodle database using this mysql command (or delete using your mysql client, e.g. PHPMyAdmin):
sql>DROP DATABASE moodle;
In the above example replace 'moodle' with the name of the moodle database you created when installing.
  • Delete the moodledata directory. If you, or your users, have uploaded materials into this directory take a copy of these before deleting this directory.
  • Delete the moodle directory itself. This will delete all of the moodle PHP script files.

XAMPP windows installation: If you have installed Moodle on windows through the XAMPP package, follow these steps:

  • Open cmd.exe and navigate to this directory within your installation directory:
server/mysql/bin
  • Run this command, replacing USERNAME with your database username (the default is "root") and DATABASE with your database name (the default is "moodle"):
mysqladmin.exe -u USERNAME -p drop DATABASE
  • Enter your database password at the prompt (the default is "" [blank]).
  • Enter "y" to confirm the database drop.
  • Delete the moodledata directory. If you, or your users, have uploaded materials into this directory take a copy of these before deleting this directory.
  • Delete the moodle directory itself. This will delete all of the moodle PHP script files.

Migrating Moodle to a new site or server

Migrating Moodle means that you have to move the current installation to a new server, and so may have to change IP addresses or DNS entries. To do this you will need to change the $CFG->wwwroot value in the config.php on the new server. You will also have to change any absolute links stored in the database backup file (before restoring the file on the new server) either using the Search and replace tool, your text editor or another "search and replace" tool, e.g. sed. For more details see the Moodle Migration page.

Top

Why does my new installation display correctly on the server, but when I view it from a different machine, styles and images are missing?

In the installation instructions, one of the suggested settings for 'webroot' is 'localhost'. This is fine if all you want to do is some local testing of your new Moodle installation. If, however, you want to view your new installation from another machine on the same local area network, or view your site on the internet, you will have to change this setting:

  • For local testing, 'localhost' is fine for the webroot ($CFG->wwwroot in config.php).
  • If you want to test your site from other machines on the same local area network (LAN), then you will have to use the private ip address of the serving machine, (e.g. 192.168.1.2/moodle) or the network name of the serving computer (e.g. network_name_of_serving_machine/moodle) as the web root. Depending on your LAN setup, it may be better to use the network name of the computer rather than its (private) ip address, because the ip address can and will change from time to time. If you don't want to use the network name, then you will have to speak to your network administrator and have them assign a permanent ip address to the serving machine.
  • Finally, if you want to test your new installation across the internet, you will have to use either a domain name or a permanent (public) ip address/moodle as your web root. To handle both types of access, see masquerading.

Top

Maximum upload file size - how to change it?

There are several places to change the maximum file upload size. The first place to check is the Administration block. Security -> Site Policies -> and look for "Maximum Uploaded File Size". This is the "maxbyte" variable found in older versions of Moodle (under Admin > Variables). Teachers may also set the maximum file size by the course administration block.

If the above does not provide a large enough figure you will need to make changes in your server settings. The usual place is in your php.ini file (go to Site administration > Server > PHPinfo and check a few lines down for its location). Look for settings upload_max_filesize and post_max_size, setting them both to your desired new value (e.g. '64MB'). You will need to restart the web server for these changes to take effect - e.g. on Linux, /etc/init.d/apache2 force-reload. Check your documentation or just reboot the server. NGINX system administrators should also add client_max_body_size=XXX to the "http" section of their nginx main configuration file. (see more info)

For more help see:

Top

Moodle claims PHP float handling is not compatible

The symptom is that when you try to install or upgrade your Moodle, you get a message "Detected unexpected problem in handling of PHP float numbers".

This forum thread and MDL-18253 have more information. In short, this problem should not happen, you can help us by telling posting information about exactly which version of PHP, and OS you are using. That may let us find a way to work around this problem.

You may be able to solve this issue by installing a more recent PHP versions. If you compile PHP yourself from source, changing the compilation options may help. However, since we don't understand the cause, we don't really know. If you do find a solution that works for you, please do tell us about it.

Update: we have a guess that the problem may be the 'precision' setting in your php.ini file. In a default PHP install this is set of 14. On at least one server that exhibited this problem it had been changed to a smaller value. So, if you see this problem, please try adding

ini_set('precision', 14);

to your config.php file, and report your success in MDL-18253.

When upgrading Moodle claims my MySQL database is not UTF8 when I'm sure it is

The UTF-8 detection for MySQL databases was finally fixed in Moodle 2.5, some incorrectly configured databases were previously reported as compatible.

Please note it is not enough to alter the charset and collation of the database, you must fix each text column in each database table!

Before going any further make sure you understand the difference between character encoding (how text is stored) and collations (the rules for comparing text strings). Collation problems will never cause this error but have a bunch of problems of their own.

See Converting your MySQL database to UTF8

Top

How do I run multiple instances of Moodle without duplicating base code?

See this thread for a detailed explanation by Martin Langhoff.

What is FreeTDS and how can I use it in my installation?

FreeTDS is an open source implementation of the Tabular Data Stream protocol used by Microsoft SQL Server and Sybase for their databases. Unfortunately, Microsoft servers don't usually accept TDS 5.0 connections. FreeTDS allows your Unix/Linux applications to talk to these other database products and import and export data between different systems successfully.

How do I install a plugin?

Please see Installing plugins.

I can't enable a plugin on the Plugins overview page because the icon is not clickable

The open and closed eye icon on the Plugins overview page is simply there to show whether or not a plugin is enabled. You can't edit plugins from this screen. If you wish to enable a plugin, to to the appropriate page for managing the type of plugin you need, for instance Settings>Site administration>Plugins>Repositories>Manage repositories or Settings>Site administration>Plugins>Activity modules>Manage activities.

See also

Once your site is installed use these movies to inform your initial site setup;

Installing Moodle in a shared web hosting environment: