Difference between revisions of "Installation FAQ"
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.
(Created fix TOC to jump back to.)
m (→Table of Contents)
|Line 1:||Line 1:|
==Table of Contents==
==Table of Contents==
==PHP - is it installed and what version do I have?==
==PHP - is it installed and what version do I have?==
Revision as of 12:03, 12 February 2009
Table of Contents
- 1 Table of Contents
- 2 PHP - is it installed and what version do I have?
- 3 System information needed for Installation problems forum
- 4 What & where are Moodle's configuration settings stored?
- 5 Downloading previous releases of Moodle
- 6 How to enable and check PHP error logs
- 7 Email copies are not being sent from my forums
- 8 I can't log in - I just stay stuck on the login screen
- 9 I log in but the login link doesn't change. I am logged in and can navigate freely.
- 10 Uploaded files give "File not found"
- 11 Why are all my pages blank?
- 12 Why is a particular page blank or incomplete?
- 13 Installation hangs when setting-up database tables
- 14 Why can't I upload a new image into my profile?
- 15 Why doesn't my Moodle site display the time and date correctly?
- 16 How do I uninstall Moodle?
- 17 How do I upgrade Moodle? Do I just overwrite the files?
- 18 I obtain the message "Upgrade already running in this session, please wait!"
- 19 Migrating Moodle to a new site or server
- 20 Why does my new installation display correctly on the server, but when I view it from a different machine, styles and images are missing?
- 21 Maximum upload file size - how to change it?
- 22 How do I install Moodle on Windows Vista?
- 23 Moodle claims PHP float handling is not compatible
- 24 See also
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.
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. Use this template to copy and paste into your post:
- Server Operating System name (version also if possible):
- Browser name (version also if possible):
- Moodle version:
- Moodle install type? (New/Upgrade):
- Moodle config.php attached?(Y/N):
- Phpinfo attached? (Y/N):
For the last two items, try to include the following in your post as an attachment:
- 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).
- 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.
If you cannot provide your phpinfo, try to copy & paste and complete these in your post:
- 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.
- Security Warning: Make sure you edit any files and delete any passwords before posting onto the forum.
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 "?>".
Downloading previous releases of Moodle
- Generic Packages: If your server does not meet the requirements for the current version of Moodle, you can download previous releases by using wget, lynx or curl with this URL:
- 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:
- 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.
- Windows Packages: To download previous releases of the Moodle packages for Windows, use this URL:
- 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):
- 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 documentation.
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.
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.Basically, you need to set up a process to regularly call the script
. Please refer to the cron instructions.
- 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
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 Norton firewall products.
Another possible cause of this problem is that sessions are not configured properly on the server. You can test this by calling the script http://yourserver/moodle/lib/session-test.php.
If you are still having problems, read the Cannot log in page.
Make sure the URL in your
$CFG->wwwrootsetting is exactly the same as the one you are actually using to access the site.
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.
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):
Note, this will ONLY work for Apache versions 2.x.
For IIS you need to configure URL rewriting. This feature is not available from Microsoft, you need to install a 3rd party IIS extension - see http://msdn.microsoft.com/en-us/library/ms972974.aspx The recommended rewriting rule is
RewriteRule ^([^\?]+?\.php)(\/.+)$ $1\?file=$2 [QSA]
In theory you could try to use path info on IIS too, but it is not reliable, especially when using unicode file names.
If you are unable to configure your server properly then you can switch Moodle to use an alternative method. The major disadvantages is that you will not be able to use SCORM packages at all and some Adobe Flash and Java applets will not work either.
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 > 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.
$CFG->dirroot = "d:\inetpub\sites\www.yoursite.com\web\moodle";
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 How to enable and check PHP error logs.
To determine if MySQL support is your problem, insert this as the second line in your config.php file
then reload the web page. Examine the output closely to see if MySQL is supported. If not look for a package you are missing.
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 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 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 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.
- Using Moodle PHP configuration error forum discussion
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:
- 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 Limiting Account Resources in the MySQL manual.
- 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.
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 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 Moodle Packages. Once you have a running Moodle, 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?
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.
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.
2. 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:
- 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?
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.
These new locale codes can be entered on the Administration >> Configuration >> Variables page, where they override the ones in the currently chosen language pack.
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.
How do I upgrade Moodle? Do I just overwrite the files?
Do not overwrite files, it may cause strange errors. You should read the Upgrade documentation before proceeding.
I obtain the message "Upgrade already running in this session, please wait!"
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
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 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?
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.
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.
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:
- These forum posts: http://moodle.org/mod/forum/discuss.php?d=63840#287960 and http://moodle.org/mod/forum/discuss.php?d=93882#p414650
How do I install Moodle on Windows Vista?
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-17868 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.