Note: You are currently viewing documentation for Moodle 1.9. 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
No edit summary
m (added PHP requirements for different versions)
 
(7 intermediate revisions by 5 users not shown)
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.7 will require PHP 5.4.4 or later
* Moodle 2.6 will require PHP 5.3.3 or later
* Moodle 2.1 will require PHP 5.3.2 or later
* 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==
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.
* For file uploads in Moodle 2 on a Windows install, the temp folder must be defined and writeable by your webserver user


==Other information==
==PHP Extensions and libraries==
** For Moodle version 1.4 or later: PHP4 (version 4.1.0 or later) or PHP5 (version 5.1.0 or later) are supported.
* The mbstring extension is recommended for Moodle 1.6 or later.
** 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.
* The iconv extension is recommended for Moodle 1.6 or later.
** Future Moodle versions 2.0 or later will require PHP5 (version 5.2.8 or later).
* [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 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.
* 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.
*** ''register_globals'' '''MUST''' be OFF
* The pgsql extension is required if you are using the PostgreSQL database.
*** ''safe_mode'' needs to be OFF.
* The zlib extension is required for zip/unzip functionality.
*** ''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.
* The pdo and pdo_sqlite extensions are required for the (experimental) SQLite 3 database support.
*** ''session.save_handler'' needs to be set to FILES.
* 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]).
*** ''magic_quotes_gpc'' should be ON. (It will be recommended to turn it off in 2.0.)
* The curl and openssl extensions are required for the Moodle network functionality (Moodle 1.8 or later).
*** ''magic_quotes_runtime'' needs to be OFF.
* The xmlrpc extension is required for the Moodle network functionality (Moodle 1.8 or later).
*** ''file_uploads'' needs to be ON.
* 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]).  
*** ''session.auto_start'' needs to be OFF.
* 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).
*** ''session.bug_compat_warn'' needs to be OFF.
==Database Support==
** PHP Extensions and libraries
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 mbstring extension is recommended for Moodle 1.6 or later.
* For Moodle 1.5, MySQL (version 3.23 or later) or PostgreSQL (7.4 or later).  
*** The iconv extension is recommended for Moodle 1.6 or later.
* For Moodle 1.6, MySQL (version 4.1.12 or later) or PostgreSQL (7.4 or later).
*** [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)
* 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])
*** 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.
* 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])
*** 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 curl extension is recommended for Moodle 1.8 or later.
*** The tokenizer extension is recommended for Moodle 1.8 or later.
*** 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.  
*** 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).
* 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.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.
Line 45: Line 47:


==See also==
==See also==
[[Installing Moodle]]
*[[Installing Moodle]]
*[[Performance]]


[[de:PHP-Versionen für Moodle]]
[[de:PHP-Versionen für Moodle]]
[[ru:Настройки PHP для разных версий Moodle]]
[[ru:Настройки PHP для разных версий Moodle]]

Latest revision as of 19:38, 24 February 2014

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.7 will require PHP 5.4.4 or later
  • Moodle 2.6 will require PHP 5.3.3 or later
  • Moodle 2.1 will require PHP 5.3.2 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.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.
  • For file uploads in Moodle 2 on a Windows install, the temp folder must be defined and writeable by your webserver user

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