Jump to content

[SOLUCIONADO] Más de 40 segundos en cargar


Silviasil

Recommended Posts

Hola,
 
Mirando el log de prestashop (1.5.2.0) veo que diariamente registra en torno a 100.000 errores como estos tres:
[Fri Oct 16 16:36:42 2015] [warn] [client xxx.xxx.xxx.xxx] mod_fcgid: stderr: PHP Notice:  Undefined offset:  1 in /var/www/vhosts/dedos.com/httpdocs/modules/icertwebcomment/icertwebcomment.php on line 215
[Fri Oct 16 16:36:42 2015] [warn] [client xxx.xxx.xxx.xxx] mod_fcgid: stderr: PHP Notice:  Undefined index:  promociones in /var/www/vhosts/dedos.com/httpdocs/cache/smarty/compile/f88bb38f2a93813e82b3ad017534780d258588c0.file.product-list.tpl.php on line 140
[Fri Oct 16 16:36:42 2015] [warn] [client xxx.xxx.xxx.xxx] mod_fcgid: stderr: PHP Notice:  Trying to get property of non-object in /var/www/vhosts/dedos.com/httpdocs/cache/smarty/compile/f88bb38f2a93813e82b3ad017534780d258588c0.file.product-list.tpl.php on line 140
[Fri Oct 16 16:36:42 2015] [warn] [client xxx.xxx.xxx.xxx] mod_fcgid: stderr: PHP Notice:  Undefined index:  promociones in /var/www/vhosts/dedos.com/httpdocs/cache/smarty/compile/f88bb38f2a93813e82b3ad017534780d258588c0.file.product-list.tpl.php on line 140
[Fri Oct 16 16:36:42 2015] [warn] [client xxx.xxx.xxx.xxx] mod_fcgid: stderr: PHP Notice:  Trying to get property of non-object in /var/www/vhosts/dedos.com/httpdocs/cache/smarty/compile/f88bb38f2a93813e82b3ad017534780d258588c0.file.product-list.tpl.php on line 140
[Fri Oct 16 16:36:42 2015] [warn] [client xxx.xxx.xxx.xxx] mod_fcgid: stderr: PHP Notice:  Undefined index:  promociones in /var/www/vhosts/dedos.com/httpdocs/cache/smarty/compile/f88bb38f2a93813e82b3ad017534780d258588c0.file.product-list.tpl.php on line 140
[Fri Oct 16 16:36:42 2015] [warn] [client xxx.xxx.xxx.xxx] mod_fcgid: stderr: PHP Notice:  Trying to get property of non-object in /var/www/vhosts/dedos.com/httpdocs/cache/smarty/compile/f88bb38f2a93813e82b3ad017534780d258588c0.file.product-list.tpl.php on line 140
[Fri Oct 16 16:36:45 2015] [warn] [client xxx.xxx.xxx.xxx] mod_fcgid: stderr: PHP Notice:  Undefined offset:  1 in /var/www/vhosts/dedos.com/httpdocs/modules/icertwebcomment/icertwebcomment.php on line 215
[Fri Oct 16 16:36:45 2015] [warn] [client xxx.xxx.xxx.xxx] mod_fcgid: stderr: PHP Notice:  Undefined index:  promociones in /var/www/vhosts/dedos.com/httpdocs/cache/smarty/compile/f88bb38f2a93813e82b3ad017534780d258588c0.file.product-list.tpl.php on line 140
[Fri Oct 16 16:36:45 2015] [warn] [client xxx.xxx.xxx.xxx] mod_fcgid: stderr: PHP Notice:  Trying to get property of non-object in /var/www/vhosts/dedos.com/httpdocs/cache/smarty/compile/f88bb38f2a93813e82b3ad017534780d258588c0.file.product-list.tpl.php on line 140
[Fri Oct 16 16:36:52 2015] [warn] [client xxx.xxx.xxx.xxx] mod_fcgid: stderr: PHP Notice:  Undefined offset:  1 in /var/www/vhosts/dedos.com/httpdocs/modules/icertwebcomment/icertwebcomment.php on line 215
[Fri Oct 16 16:36:52 2015] [warn] [client xxx.xxx.xxx.xxx] mod_fcgid: stderr: PHP Notice:  Undefined index:  promociones in /var/www/vhosts/dedos.com/httpdocs/cache/smarty/compile/f88bb38f2a93813e82b3ad017534780d258588c0.file.product-list.tpl.php on line 121
[Fri Oct 16 16:36:52 2015] [warn] [client xxx.xxx.xxx.xxx] mod_fcgid: stderr: PHP Notice:  Trying to get property of non-object in /var/www/vhosts/dedos.com/httpdocs/cache/smarty/compile/f88bb38f2a93813e82b3ad017534780d258588c0.file.product-list.tpl.php on line 121

Esta es la línea 215 del archivo icertwebcomment.php:

$puntuaciondecimal = $puntuacionsep[1];
Esta es la línea 121 del archivo f88bb38f2a93813e82b3ad017534780d258588c0.file.product-list.tpl.php:
<?php if (($_smarty_tpl->tpl_vars['id_categoria_padre']->value==8)||($_smarty_tpl->tpl_vars['promociones']->value==1)){?>

Esta es la línea 140 del archivo f88bb38f2a93813e82b3ad017534780d258588c0.file.product-list.tpl.php:
<?php if ($_smarty_tpl->tpl_vars['promociones']->value==1){?>

El problema es que cualquier petición genera una cantidad enorme de tráfico y satura la cpu, apache y la ram (8GB). La página tarda más de 40 segundos en cargar.
 
¿Alguien me puede echar una mano para solucionar este problema?
 
Gracias
Saludos
 
[sOLUCIÓN] Se conoce que en la migración se corrompió el archivo /themes/default/product-list.tpl. Lo cargué de nuevo (del backup original) por FTP y desapareció el error. Joseantgv, agradezco mucho tu ayuda, me marcaste el camino a la solución.

 

 

 

Edited by Silviasil (see edit history)
Link to comment
Share on other sites

Para el primer error puedes poner:

if (isset($puntuacionsep[1])) {
    $puntuaciondecimal = $puntuacionsep[1];
}

Aunque luego quizás te aparece el mismo error pero para la variable $puntuaciondecimal. Entonces habría que inicializarla:

$puntuaciondecimal = '';
if (isset($puntuacionsep[1])) {
    $puntuaciondecimal = $puntuacionsep[1];
}

Para el 2º y 3º busca en el fichero /themes/tu-tema/product-list.tpl la palabra "promociones", a ver si hay muchas líneas.

 

Eso te aparece porque te han hecho alguna modificación y no la han dejado demasiado bien.

  • Like 1
Link to comment
Share on other sites

Para el primer error puedes poner:

if (isset($puntuacionsep[1])) {
    $puntuaciondecimal = $puntuacionsep[1];
}

Aunque luego quizás te aparece el mismo error pero para la variable $puntuaciondecimal. Entonces habría que inicializarla:

$puntuaciondecimal = '';
if (isset($puntuacionsep[1])) {
    $puntuaciondecimal = $puntuacionsep[1];
}

Para el 2º y 3º busca en el fichero /themes/tu-tema/product-list.tpl la palabra "promociones", a ver si hay muchas líneas.

 

Eso te aparece porque te han hecho alguna modificación y no la han dejado demasiado bien.

Hola joseantgv,
 
Gracias por tu respuesta en primer lugar. Te envío las líneas anteriores y posteriores para que veas el código y me indiques si la recomendación que me haces el la correcta:
if ($this->estado == '1'){
	  foreach ($this->xml->comentario as $comentario)
	  {
		  
		$puntuacionsep = explode(".",$comentario->puntuacion);
		$puntuacionentero = $puntuacionsep[0];
		$puntuaciondecimal = $puntuacionsep[1];
		
		  if ($puntuaciondecimal <= '2'){ 
		  		$puntuaciondecimal = '0';
		  }elseif(($puntuaciondecimal > '2')&&($puntuaciondecimal < '8')) {
			  	$puntuaciondecimal = '5';
		  }elseif($puntuaciondecimal >= '8') {
			  $puntuacionentero = $puntuacionentero +1;
			  $puntuaciondecimal = '0';
		  }

Para el 2º y 3º aparecen las 3 veces que te muestro a continuación:

1ª:

<div class="content_price">
                	{if ($id_categoria_padre == 8) || ($promociones == 1)} <!-- Condicion -->
                        {if isset($product.show_price) && $product.show_price && !isset($restricted_country_mode)}
                            <span class="price" style="display: inline; font-size:12px">
                            {if !$priceDisplay}
                                {$precio_pack=$product.price}
                            {else}
                                {$precio_pack=$product.price_tax_exc}
                            {/if}

2ª:

{$realunit=0}
                        {math equation="b/a" a=25 b=$precio_pack assign=realunit}
                        {if ($id_categoria_padre == 8) || (($promociones == 1) && (($product.id_product < 111) || ($product.id_product == 120) || ($product.id_product == 122) || ($product.id_product == 128) || ($product.id_product == 129) || ($product.id_product == 136) || ($product.id_product == 144) || ($product.id_product == 149) || ($product.id_product == 150)))}
                        <span class="unit-price-list" style="font-size:18px">{convertPrice price=$realunit} {l s="por producto"}</span><br />
                        {/if}

3ª:

{if $promociones == 1}
                            	{if (($product.id_product < 111) || ($product.id_product == 120) || ($product.id_product == 122) || ($product.id_product == 128) || ($product.id_product == 129) || ($product.id_product == 136) || ($product.id_product == 144) || ($product.id_product == 149) || ($product.id_product == 150))}
                                	<span class="price" style="display: inline; font-size:12px">
                                {else}
                                	<span class="price" style="display: inline; font-size:18px">
                                {/if}

Muchas gracias por tu ayuda.

 
Edited by Silviasil (see edit history)
Link to comment
Share on other sites

Para el primero lo dejaría así:

$puntuaciondecimal = 0;
if (isset($puntuacionsep[1])) {
    $puntuaciondecimal = $puntuacionsep[1];
}

Revisa que no te provoque ningún error en las puntuaciones que deben aparecer en el front.

 

Para los otros errores, antes de la 1ª aparición de "promociones" pon:

{if (!isset($promociones))}
    {assign var=promociones value=0}
{endif}

PD: Quién te ha hecho esos desarrollos?

  • Like 1
Link to comment
Share on other sites

Para el primero lo dejaría así:

$puntuaciondecimal = 0;
if (isset($puntuacionsep[1])) {
    $puntuaciondecimal = $puntuacionsep[1];
}

Revisa que no te provoque ningún error en las puntuaciones que deben aparecer en el front.

 

Para los otros errores, antes de la 1ª aparición de "promociones" pon:

{if (!isset($promociones))}
    {assign var=promociones value=0}
{endif}

PD: Quién te ha hecho esos desarrollos?

 
 
 
Voy a aplicar los cambios que me indicas y observaré el comportamiento que apuntas en el front y te comenteré si el error_log ha suprimido los mensajes.
 
Que quien me ha hecho esos desarrollos me preguntas?. Un "desarrollador" de catástrofes por lo que veo. Contenta me tiene!
 
Muchas gracias de nuevo por tu ayuda.
Edited by Silviasil (see edit history)
Link to comment
Share on other sites

  • nadie locked this topic
Guest
This topic is now closed to further replies.
×
×
  • Create New...