Note: You are currently viewing documentation for Moodle 2.3. Up-to-date documentation for the latest stable version is available here: PHP settings by Moodle version.

PHP settings by Moodle version: Difference between revisions

From MoodleDocs
m (Changed magic_quotes_gpc requirement from ON to OFF)
No edit summary
Line 2: Line 2:
and  
and  
{{Review}}{{Template:Installing Moodle}}
{{Review}}{{Template:Installing Moodle}}
==PHP Version==
Moodle has different PHP requirements for different versions:
Moodle has different PHP requirements for different versions:
* Moodle 2.0 will require PHP 5.2.8 or later.
* Moodle 2.0 will require PHP 5.2.8 or later.
* Moodle 1.6 to 1.9 requires PHP 4.3.0 or later
* Moodle 1.6 to 1.9 requires PHP 4.3.0 or later
* Moodle 1.0 to 1.5 requires PHP 4.1.0 or later  
* Moodle 1.0 to 1.5 requires PHP 4.1.0 or later  
 
==PHP Settings==
==Other information==
Check these settings in your php.ini or .htaccess file (if you're using Apache). For settings which use ON/OFF as their values, you can substitute 1 for ON and 0 for OFF if you prefer.  
** For Moodle version 1.4 or later: PHP4 (version 4.1.0 or later) or PHP5 (version 5.1.0 or later) are supported.
* ''register_globals'' '''MUST''' be OFF
** For Moodle version 1.6 or later: the PHP4 (version 4.3.0 or later) or PHP5 (version 5.1.0 or later) are supported.
* ''safe_mode'' needs to be OFF.
** Future Moodle versions 2.0 or later will require PHP5 (version 5.2.8 or later).
* ''memory_limit'' should be at least 16M (32M is recommended for Moodle 1.7 and 40M for Moodle 1.8 or later). Large sites may need more than 128M. PHP 5.2.x requires higher memory_limit values than previous versions of PHP. 64bit operating systems require even more memory.
** PHP Settings. Check these settings in your php.ini or .htaccess file (if you're using Apache). For settings which use ON/OFF as their values, you can substitute 1 for ON and 0 for OFF if you prefer.  
* ''session.save_handler'' needs to be set to FILES.
*** ''register_globals'' '''MUST''' be OFF
* ''magic_quotes_gpc'' should be OFF. (It will be an installation pre-requisite for this to be turned off from 2.0 onwards.)
*** ''safe_mode'' needs to be OFF.
* ''magic_quotes_runtime'' needs to be OFF.
*** ''memory_limit'' should be at least 16M (32M is recommended for Moodle 1.7 and 40M for Moodle 1.8 or later). Large sites may need more than 128M. PHP 5.2.x requires higher memory_limit values than previous versions of PHP. 64bit operating systems require even more memory.
* ''file_uploads'' needs to be ON.
*** ''session.save_handler'' needs to be set to FILES.
* ''session.auto_start'' needs to be OFF.
*** ''magic_quotes_gpc'' should be OFF. (It will be an installation pre-requisite for this to be turned off from 2.0 onwards.)
* ''session.bug_compat_warn'' needs to be OFF.
*** ''magic_quotes_runtime'' needs to be OFF.
==PHP Extensions and libraries==
*** ''file_uploads'' needs to be ON.
* The mbstring extension is recommended for Moodle 1.6 or later.
*** ''session.auto_start'' needs to be OFF.
* The iconv extension is recommended for Moodle 1.6 or later.
*** ''session.bug_compat_warn'' needs to be OFF.
* [http://www.libgd.org/ GD library] and the [http://www.freetype.org/ FreeType 2] library and extensions are needed to be able to look at the dynamic graphs that the logs pages make. (Freetype support is available as part of the GD extension for the 5.x versions of PHP)
** PHP Extensions and libraries
* The mysql extension is required if you are using the MySQL database. Note that in some Linux distributions (notably Red Hat) this is an optional installation.
*** The mbstring extension is recommended for Moodle 1.6 or later.
* The pgsql extension is required if you are using the PostgreSQL database.
*** The iconv extension is recommended for Moodle 1.6 or later.
* The zlib extension is required for zip/unzip functionality.
*** [http://www.libgd.org/ GD library] and the [http://www.freetype.org/ FreeType 2] library and extensions are needed to be able to look at the dynamic graphs that the logs pages make. (Freetype support is available as part of the GD extension for the 5.x versions of PHP)
* The pdo and pdo_sqlite extensions are required for the (experimental) SQLite 3 database support.
*** The mysql extension is required if you are using the MySQL database. Note that in some Linux distributions (notably Red Hat) this is an optional installation.
* The tokenizer extension is recommended for Moodle 1.8 or later (enabled by default as of [http://www.php.net/manual/en/tokenizer.installation.php PHP 4.3.0]).
*** The pgsql extension is required if you are using the PostgreSQL database.
* The curl and openssl extensions are required for the Moodle network functionality (Moodle 1.8 or later).
*** The zlib extension is required for zip/unzip functionality.
* The xmlrpc extension is required for the Moodle network functionality (Moodle 1.8 or later).
*** The pdo and pdo_sqlite extensions are required for the (experimental) SQLite 3 database support.
* The ctype extension is recommended for Moodle 1.8 or later (enabled by default as of [http://www.php.net/manual/en/ctype.installation.php PHP 4.2.0]).  
*** The curl extension is recommended for Moodle 1.8 or later.
* Other PHP extensions may be required to support optional Moodle functionality, especially external authentication and/or enrolment (e.g. LDAP extension for LDAP authentication and the sockets extension for Chat server).
*** The tokenizer extension is recommended for Moodle 1.8 or later (enabled by default as of [http://www.php.net/manual/en/tokenizer.installation.php PHP 4.3.0]).
==Database Support==
*** The curl and openssl extensions are required for the Moodle network functionality (Moodle 1.8 or later).
A working database server: [[MySQL]] or [[PostgreSQL]] are completely supported and recommended for use with any version of Moodle. Support for Microsoft SQL Server and Oracle has been added in Moodle 1.7. MySQL is ''the'' choice for many people because it is very popular, but there are some [[Arguments in favour of PostgreSQL|arguments in favour of PostgreSQL]], especially if you are planning a large deployment.
*** The xmlrpc extension is required for the Moodle network functionality (Moodle 1.8 or later).
* For Moodle 1.5, MySQL (version 3.23 or later) or PostgreSQL (7.4 or later).  
*** The ctype extension is recommended for Moodle 1.8 or later (enabled by default as of [http://www.php.net/manual/en/ctype.installation.php PHP 4.2.0]).  
* For Moodle 1.6, MySQL (version 4.1.12 or later) or PostgreSQL (7.4 or later).
*** Other PHP extensions may be required to support optional Moodle functionality, especially external authentication and/or enrolment (e.g. LDAP extension for LDAP authentication and the sockets extension for Chat server).
* For Moodle 1.7, MySQL (version 4.1.12 or later), PostgreSQL (7.4 or later) or Microsoft SQL Server 2005 (version 9 or [http://moodle.org/mod/forum/discuss.php?d=59284 SQL Server Express 2005])
* A working database server: [[MySQL]] or [[PostgreSQL]] are completely supported and recommended for use with any version of Moodle. Support for Microsoft SQL Server and Oracle has been added in Moodle 1.7. MySQL is ''the'' choice for many people because it is very popular, but there are some [[Arguments in favour of PostgreSQL|arguments in favour of PostgreSQL]], especially if you are planning a large deployment.
* For Moodle 1.8 or later, MySQL (version 4.1.12 or later), PostgreSQL (8.0 or later) or Microsoft SQL Server 2005 (version 9 or [http://moodle.org/mod/forum/discuss.php?d=59284 SQL Server Express 2005])
** For Moodle 1.5, MySQL (version 3.23 or later) or PostgreSQL (7.4 or later).  
** For Moodle 1.6, MySQL (version 4.1.12 or later) or PostgreSQL (7.4 or later).
** For Moodle 1.7, MySQL (version 4.1.12 or later), PostgreSQL (7.4 or later) or Microsoft SQL Server 2005 (version 9 or [http://moodle.org/mod/forum/discuss.php?d=59284 SQL Server Express 2005])
** For Moodle 1.8 or later, MySQL (version 4.1.12 or later), PostgreSQL (8.0 or later) or Microsoft SQL Server 2005 (version 9 or [http://moodle.org/mod/forum/discuss.php?d=59284 SQL Server Express 2005])
: MySQL Notes: For Moodle 1.6 or later, If you use latin languages only you can use MySQL 4.1.12. If you are using non-latin languages you require MySQL 4.1.16 or later. Currently the MySQL setting "strict mode" must be OFF (set to "" or "MYSQL40") in the MySQL configuration file.  
: MySQL Notes: For Moodle 1.6 or later, If you use latin languages only you can use MySQL 4.1.12. If you are using non-latin languages you require MySQL 4.1.16 or later. Currently the MySQL setting "strict mode" must be OFF (set to "" or "MYSQL40") in the MySQL configuration file.  
: PostgreSQL Notes: PostgreSQL 7.4 is recommended for earlier Moodle versions, since Moodle 1.8 only PostgreSQL 8.0 and above are supported.
: PostgreSQL Notes: PostgreSQL 7.4 is recommended for earlier Moodle versions, since Moodle 1.8 only PostgreSQL 8.0 and above are supported.

Revision as of 08:03, 15 April 2010

and

This page requires a review. Please do so and remove this template when finished.

PHP Version

Moodle has different PHP requirements for different versions:

  • Moodle 2.0 will require PHP 5.2.8 or later.
  • Moodle 1.6 to 1.9 requires PHP 4.3.0 or later
  • Moodle 1.0 to 1.5 requires PHP 4.1.0 or later

PHP Settings

Check these settings in your php.ini or .htaccess file (if you're using Apache). For settings which use ON/OFF as their values, you can substitute 1 for ON and 0 for OFF if you prefer.

  • register_globals MUST be OFF
  • safe_mode needs to be OFF.
  • memory_limit should be at least 16M (32M is recommended for Moodle 1.7 and 40M for Moodle 1.8 or later). Large sites may need more than 128M. PHP 5.2.x requires higher memory_limit values than previous versions of PHP. 64bit operating systems require even more memory.
  • session.save_handler needs to be set to FILES.
  • magic_quotes_gpc should be OFF. (It will be an installation pre-requisite for this to be turned off from 2.0 onwards.)
  • magic_quotes_runtime needs to be OFF.
  • file_uploads needs to be ON.
  • session.auto_start needs to be OFF.
  • session.bug_compat_warn needs to be OFF.

PHP Extensions and libraries

  • The mbstring extension is recommended for Moodle 1.6 or later.
  • The iconv extension is recommended for Moodle 1.6 or later.
  • GD library and the FreeType 2 library and extensions are needed to be able to look at the dynamic graphs that the logs pages make. (Freetype support is available as part of the GD extension for the 5.x versions of PHP)
  • The mysql extension is required if you are using the MySQL database. Note that in some Linux distributions (notably Red Hat) this is an optional installation.
  • The pgsql extension is required if you are using the PostgreSQL database.
  • The zlib extension is required for zip/unzip functionality.
  • The pdo and pdo_sqlite extensions are required for the (experimental) SQLite 3 database support.
  • The tokenizer extension is recommended for Moodle 1.8 or later (enabled by default as of PHP 4.3.0).
  • The curl and openssl extensions are required for the Moodle network functionality (Moodle 1.8 or later).
  • The xmlrpc extension is required for the Moodle network functionality (Moodle 1.8 or later).
  • The ctype extension is recommended for Moodle 1.8 or later (enabled by default as of PHP 4.2.0).
  • Other PHP extensions may be required to support optional Moodle functionality, especially external authentication and/or enrolment (e.g. LDAP extension for LDAP authentication and the sockets extension for Chat server).

Database Support

A working database server: MySQL or PostgreSQL are completely supported and recommended for use with any version of Moodle. Support for Microsoft SQL Server and Oracle has been added in Moodle 1.7. MySQL is the choice for many people because it is very popular, but there are some arguments in favour of PostgreSQL, especially if you are planning a large deployment.

  • For Moodle 1.5, MySQL (version 3.23 or later) or PostgreSQL (7.4 or later).
  • For Moodle 1.6, MySQL (version 4.1.12 or later) or PostgreSQL (7.4 or later).
  • For Moodle 1.7, MySQL (version 4.1.12 or later), PostgreSQL (7.4 or later) or Microsoft SQL Server 2005 (version 9 or SQL Server Express 2005)
  • For Moodle 1.8 or later, MySQL (version 4.1.12 or later), PostgreSQL (8.0 or later) or Microsoft SQL Server 2005 (version 9 or SQL Server Express 2005)
MySQL Notes: For Moodle 1.6 or later, If you use latin languages only you can use MySQL 4.1.12. If you are using non-latin languages you require MySQL 4.1.16 or later. Currently the MySQL setting "strict mode" must be OFF (set to "" or "MYSQL40") in the MySQL configuration file.
PostgreSQL Notes: PostgreSQL 7.4 is recommended for earlier Moodle versions, since Moodle 1.8 only PostgreSQL 8.0 and above are supported.
  • For showcases or low to medium-sized installations, Moodle 2.0 also includes (experimental) support for SQLite 3 database. This setup requires no database server, as the database file is stored in a local directory on the server.

See also

Installing Moodle