Note: You are currently viewing documentation for Moodle 2.0. Up-to-date documentation for the latest stable version is available here: Installing Moodle/Creating custom php.ini files.

Installing Moodle/Creating custom php.ini files: Difference between revisions

From MoodleDocs
Line 40: Line 40:
  post_max_size = 16M
  post_max_size = 16M
  upload_max_filesize = 16M
  upload_max_filesize = 16M
=== See also ===
See [[PHP settings by Moodle version]] for more information on different settings by Moodle version.

Revision as of 16:30, 1 April 2009

Critical to any installation using php is your php.ini file, which contains directives for you usage of php. This is especially true with respect to a number of moodle settings such as max upload and max post sizes with file upload

How php.ini is used

Sourcing

Search order and why that is important why phpinfo will not tell you what php.ini is being sourced site wide when you are suing php4

Invocation

Apached mod versus CGI Why you don't have to reread webserver files where you are using php via cgi


Manipulating php.ini

Editing the php.ini file generally

php.ini with shared hosts

wrappers etc

Moodle specific php.ini settings

Common php.ini settings

Please see PHP settings by Moodle version for additional details.

In the discussion below you can substitute Off for 0 and On for 1.

register_globals = 0         ;(necessary)
safe_mode = 0                ;(necessary)
memory_limit = 40M           ;(varies: minimum 16M, 32M Moodle v1.7, 40M Moodle v1.8, 128M large sites)
session.save_handler = files ;(unless you are using another handler, e.g. mm)   
magic_quotes_gpc = 1         ;(preferred but not necessary, 0 will be highly recommended in 2.0)
magic_quotes_runtime = 0     ;(necessary)
file_uploads = 1
session.auto_start = 0       ;(necessary)
session.bug_compat_warn = 0

Max file size settings

You may also want to set other, optional php.ini file settings while you are already editing it. For instance, you may want to reset the maximum upload size of file attachments, which usually defaults to 2M(egabytes). For instance, to set these to 16 Megabytes:

post_max_size = 16M
upload_max_filesize = 16M

See also

See PHP settings by Moodle version for more information on different settings by Moodle version.