php.ini

De MoodleDocs

Nota: Pendiente de Traducir. ¡Anímese a traducir esta página!.     ( y otras páginas pendientes)

Moodle 1.9

Su archivo php.ini es crítico para cualquier instalación que use PHP, pues contiene directivas para el uso de php. Esto es especialmente cierto con respecto a varias configuraciones de Moodle, tales como los tamaños para max upload y max post al subir archivos al servidor

Cómo se usa php.ini

Sourcing

PHP searches for php.ini in a specific order in php5 (in php4 you were required to place a copy of php.ini in every directory from which you wished to run a php script which would be impacted by php.ini - looking at phpinfo.php if you are running php4 will only tell you the location of the php.ini files in one directory....)

For information on sourcing see: http://www.askapache.com/2007/php/custom-phpini-tips-and-tricks.html http://us2.php.net/configuration

Configuración del Apache versus php.ini

Remember, you can effect the behavior of php via php.ini or via htaccess or apache conf files. You should NOT do both. As noted here: http://moodle.org/mod/forum/discuss.php?d=124441&parent=550026 In some types of installations there are apache configuration files that set php values, such as max upload file size. Editing php.ini will not have the desired result if apache configuration files provide php directives.

Invocación

PHP can be run via mod_php or as a cgi program. If the latter is used there are some security considerations to address /need section on php cgi security?/ An artifact of running php as CGI is that since php is invoked everytime a php script is called, you need not restart apache to force a rereading of the php.ini file. http://us2.php.net/manual/en/security.cgi-bin.force-redirect.php


Manipulación de php.ini

Edición general del archivo php.ini

A general listing of core directives that can be placed in php.ini can be found here. Remember that various versions of php have changed what are allowable directives in php.ini.

Make sure you use a real text editor and make sure you back up any file before editing it.

php.ini con alojamiento compartido (shared hosts)

wrappers etc

Configuraciones de php.ini específicas para Moodle

Configuraciones comunes de php.ini

Por favor vea https://docs.moodle.org/19/en/PHP_settings_by_Moodle_version para más detalles.

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 = 0  ;(preferred but not necessary, necessary from 2.0 onwards) magic_quotes_runtime = 0  ;(necessary) file_uploads = 1 session.auto_start = 0  ;(necessary) session.bug_compat_warn = 0

Configuraciones para el tamaño máximo de archivo

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

Si Usted está corriendo PHP4, puede necesitar copiar el archivo php.ini a varias carpetas para que funcione:

  1. public_html
  2. moodle/admin
  3. moodle/course
  4. moodle/files
  5. raíz d esu directorio moodledata

Vea también

Configuraciones de PHP según la versión de Moodle

Vea https://docs.moodle.org/19/en/PHP_settings_by_Moodle_version para más información sobre configuraciones de PHP para diferentes versiones de Moodle

PHP requerido según la versión de Moodle a instalar

Moodle requiere una versión de PHP diferente según la versión de Moodle:

  • Moodle 2.7 requiere PHP 5.4.4 o superior
  • Moodle 2.6 requiere PHP 5.3.3 o superior
  • Moodle 2.1 requiere PHP 5.3.2 o superior
  • Moodle 2.0 requiere PHP 5.2.8 o superior
  • Moodle 1.6 a 1.9 requiere PHP 4.3.0 o superior
  • Moodle 1.0 a 1.5 requiere PHP 4.1.0 o superior