Error fatal: Tiempo máximo de ejecución de 300 segundos excedido


Sigo recibiendo este error de PHP:

Error fatal: Tiempo máximo de ejecución de 300 segundos excedido

He intentado configurar mis ajustes max_execution_time y max_input_time en php.ini (tanto apache como cli) a 0, -1 y 4000 segundos cada uno.

Y todavía me sale el error diciendo:

Error fatal: Tiempo máximo de ejecución de 300 segundos excedido

También mi script se ejecuta durante 300 segundos antes de recibir este mensaje

Yo soy ejecutar el script a través de la línea de comandos.

También he comprobado mi phpinfo() así que ver cuál php.ini estoy usando.

Aún más interesante he intentado configurar max_execution_time y max_input_time los ajustes a 5 segundos y mi script se ejecutará más allá de los 5 segundos antes de obtener:

Error fatal: Tiempo máximo de ejecución de 300 segundos excedido

Author: JakeGould, 2011-10-07

16 answers

Al principio de su script puede agregar.

ini_set('MAX_EXECUTION_TIME', -1);
 51
Author: Tules,
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/ajaxhispano.com/template/agent.layouts/content.php on line 61
2011-10-06 21:23:34

Si está utilizando WAMP Vaya a:

Aumentar el max_execution_time en php.ini luego ir a

C:\wamp\apps\phpmyadmin3.4.10.1\libraries (cambiar ruta de acuerdo a su instalación)

Abre config.default.php y cambia el valor de $cfg['ExecTimeLimit'] a 0:

$cfg['ExecTimeLimit'] = 0;

Esto resolverá el problema de las importaciones de phpMyAdmin.

 74
Author: Vipin Dubey,
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/ajaxhispano.com/template/agent.layouts/content.php on line 61
2014-07-21 19:50:35

Usuarios de Xampp

  1. Ir a xampp\phpMyAdmin\
  2. Abra la configuración.inc.php
  3. Buscar $cfg['ExecTimeLimit'] = 300;
  4. Cambiar a 0 para ilimitado o poner un valor mayor
  5. If not found add $cfg['ExecTimeLimit'] = 0; (or a larger value)
  6. Guarde el archivo y reinicie el servidor
 42
Author: Technotronic,
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/ajaxhispano.com/template/agent.layouts/content.php on line 61
2018-02-07 14:56:03

Me encontré con una situación similar, y resulta que Codeigniter (el framework PHP que estaba usando) en realidad establece su propio límite de tiempo:

En system/core/Codeigniter.php, línea 106 en la versión 2.1.3 aparece lo siguiente:

if (function_exists("set_time_limit") == TRUE AND @ini_get("safe_mode") == 0)
{
    @set_time_limit(300);
}

Como no había otra manera de evitar cambiar el archivo core, lo eliminé para permitir la configuración a través de php.ini, así como dar el tiempo de ejecución máximo infinito para una solicitud de CLI.

Recomiendo grabar este cambio en algún lugar en sin embargo, el caso de las futuras actualizaciones de la versión de CI.

 23
Author: xiankai,
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/ajaxhispano.com/template/agent.layouts/content.php on line 61
2013-04-17 03:50:24

Intente algo como lo siguiente en su script:

set_time_limit(1200);
 9
Author: Darth Egregious,
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/ajaxhispano.com/template/agent.layouts/content.php on line 61
2011-10-06 21:22:47

Esta es la respuesta correcta:

Ir a

c:\wamp\apps\phpmyadmin3.4.10.1\libraries\config.default.php

Buscar y establecer

$cfg['ExecTimeLimit'] = 0;

Reiniciar todos los servicios y hecho.

 6
Author: llioor,
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/ajaxhispano.com/template/agent.layouts/content.php on line 61
2013-10-09 15:57:51

Vaya a la configuración de xampp/phpmyadmin/libraries/.predeterminado.php

Y realice los siguientes cambios

from  $cfg['ExecTimeLimit'] = ’300′;
to  $cfg['ExecTimeLimit'] = ’0′;
 3
Author: Gaurav Arora,
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/ajaxhispano.com/template/agent.layouts/content.php on line 61
2017-02-08 18:54:51

El tiempo de ejecución predeterminado de la CLI de PHP es infinito.

Esto establece el tiempo máximo en segundos que un script puede ejecutar antes de que sea terminado por el analizador. Esto ayuda a prevenir mal guiones escritos de atar el servidor. El valor predeterminado es 30. Cuando se ejecuta PHP desde la línea de comandos, la configuración predeterminada es 0.

Http://gr.php.net/manual/en/info.configuration.php#ini.max-execution-time

Compruebe si está ejecutando PHP en modo seguro, porque ignora todos los ajustes exec tiempo cuando en eso.

 1
Author: Mob,
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/ajaxhispano.com/template/agent.layouts/content.php on line 61
2011-10-06 21:35:35

USUARIOS DE WAMP:

1) Ir a C:\wamp\apps\phpmyadmin

2) Abrir configuración.inc

3) Agregue cf cfg['ExecTimeLimit'] = '3600'; al archivo.

4) Guarde el archivo y reinicie el servidor.

Este archivo sobrescribe el php.ini y va a trabajar para usted!

 0
Author: Asi,
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/ajaxhispano.com/template/agent.layouts/content.php on line 61
2013-12-09 15:43:02

En mi caso, cuando me enfrenté a ese error en Phpmyadmin, probé MySQL-Front e importé mi base de datos con éxito.

Nota: Todavía puede utilizar las soluciones proporcionadas en esta pregunta para resolver su problema en Phpmyadmin.

 0
Author: Jamshid Hashimi,
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/ajaxhispano.com/template/agent.layouts/content.php on line 61
2014-03-05 09:41:19

Si las respuestas anteriores no funcionan, intente verificar su código,,En mi experiencia,tener un bucle infinito también causará ese problema.Revise su declaración else if.

 0
Author: rai,
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/ajaxhispano.com/template/agent.layouts/content.php on line 61
2015-03-30 04:58:46

En Codeignitor versión 3.0.x el system / core / Codeigniter.php no contiene la restricción de tiempo, así como la inserción de

ini_set('MAX_EXECUTION_TIME', -1);  

No funcionará ya que codeignitor lo anulará con su propia función set_time_limit() . Así que, o bien tienes que eliminar esa función del codeignitor o simplemente puedes insertar

set_time_limit('1000');

Al principio del archivo php si quieres cambiarlo a 1000 segundos. Establezca el tiempo en 0 (cero) si desea ejecutarlo todo el tiempo que desee.

 0
Author: Wenuka,
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/ajaxhispano.com/template/agent.layouts/content.php on line 61
2016-10-04 09:13:48

En Xampp, en php.ini debe comprobar mysql.connect_timeout bien. Así, por ejemplo, cámbielo a:

mysql.connect_timeout = 3600

Ese tiempo siempre se contará en segundos (así que 1 hora en mi ejemplo)

 0
Author: andymnc,
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/ajaxhispano.com/template/agent.layouts/content.php on line 61
2016-11-09 08:04:34

USUARIOS MAMP edición de php.ini resuelve esto - hay una línea:

Max_execution_time = 30; Tiempo máximo de ejecución de cada script, en segundos

Establecer esto a un valor más alto funcionó.

El archivo está en php/php5.6.25/conf/php.ini (obviamente necesitas mojar el archivo para la versión de php que estás usando - puedes encontrar esto en las preferencias de MAMP.

 0
Author: Jeremy Young,
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/ajaxhispano.com/template/agent.layouts/content.php on line 61
2016-12-02 18:25:27

Para AppServ local

Ir a C:\AppServ\www\phpMyAdmin\libraries\config.predeterminado.php

Busque $cfg['ExecTimeLimit'] y establezca el valor en 0.

Así que parecerá

$cfg['ExecTimeLimit'] = 0;
 0
Author: Zunnie Kanittika,
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/ajaxhispano.com/template/agent.layouts/content.php on line 61
2018-01-31 01:38:32

Puede establecer el límite de tiempo:

ini_set('max_execution_time', 1000000000000000);
 -1
Author: binhhoang18,
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/ajaxhispano.com/template/agent.layouts/content.php on line 61
2015-09-29 05:02:07