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
No edit summary
No edit summary
Line 1: Line 1:
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  
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=
==How php.ini is used==
==Sourcing==
===Sourcing===
Search order and why that is important
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
why phpinfo will not tell you what php.ini is being sourced site wide when you are suing php4
==Invocation==
===Invocation===
Apached mod versus CGI
Apached mod versus CGI
Why you don't have to reread webserver files where you are using php via cgi
Why you don't have to reread webserver files where you are using php via cgi
Line 11: Line 11:




=Manipulating php.ini=
==Manipulating php.ini==
==Editing the php.ini file generally==
===Editing the php.ini file generally===


==php.ini with shared hosts==
===php.ini with shared hosts===
wrappers etc
wrappers etc


=Moodle specific php.ini settings=
==Moodle specific php.ini settings==
==Common php.ini settings==
===Common php.ini settings===
<code>
<code>
  register_globals = 0        ;(necessary)
  register_globals = 0        ;(necessary)
Line 31: Line 31:
</code>
</code>


== Max file size settings ==
===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:
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
  post_max_size = 16M
  upload_max_filesize = 16M
  upload_max_filesize = 16M

Revision as of 18:50, 3 March 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

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