Jump to content

El Acceso De Apache, Tiene Millones De Errores


Recommended Posts

Hola estoy teniendo problemas con el acceso de Apache, me aparece los siguientes errores que no tengo ni idea de como solucionarlos... :

 

 

[Thu Feb 04 09:53:41 2016] [error] [client 66.249.66.130] FastCGI: server "/usr/sbin/php-fpm-edenhogar.com" stderr: PHP message: PHP Warning: preg_replace(): Compilation failed: invalid range in character class at offset 24 in /var/www/vhosts/edenhogar.com/httpdocs/classes/Tools.php on line 1079
[Thu Feb 04 09:53:41 2016] [error] [client 66.249.66.130] FastCGI: server "/usr/sbin/php-fpm-edenhogar.com" stderr: PHP message: PHP Warning: preg_replace(): Compilation failed: invalid range in character class at offset 24 in /var/www/vhosts/edenhogar.com/httpdocs/classes/Tools.php on line 1079
[Thu Feb 04 09:53:41 2016] [error] [client 66.249.66.130] FastCGI: server "/usr/sbin/php-fpm-edenhogar.com" stderr: PHP message: PHP Warning: preg_replace(): Compilation failed: invalid range in character class at offset 24 in /var/www/vhosts/edenhogar.com/httpdocs/classes/Tools.php on line 1079
[Thu Feb 04 09:53:41 2016] [error] [client 66.249.66.130] FastCGI: server "/usr/sbin/php-fpm-edenhogar.com" stderr: PHP message: PHP Warning: preg_replace(): Compilation failed: invalid range in character class at offset 24 in /var/www/vhosts/edenhogar.com/httpdocs/classes/Tools.php on line 1079
[Thu Feb 04 09:53:41 2016] [error] [client 66.249.66.130] FastCGI: server "/usr/sbin/php-fpm-edenhogar.com" stderr: PHP message: PHP Warning: preg_replace(): Compilation failed: invalid range in character class at offset 24 in /var/www/vhosts/edenhogar.com/httpdocs/classes/Tools.php on line 1079
[Thu Feb 04 09:53:41 2016] [error] [client 66.249.66.130] FastCGI: server "/usr/sbin/php-fpm-edenhogar.com" stderr: PHP message: PHP Warning: preg_replace(): Compilation failed: invalid range in character class at offset 24 in /var/www/vhosts/edenhogar.com/httpdocs/classes/Tools.php on line 1079
[Thu Feb 04 09:53:41 2016] [error] [client 66.249.66.130] FastCGI: server "/usr/sbin/php-fpm-edenhogar.com" stderr: PHP message: PHP Warning: preg_replace(): Compilation failed: invalid range in character class at offset 24 in /var/www/vhosts/edenhogar.com/httpdocs/classes/Tools.php on line 1079
[Thu Feb 04 09:53:41 2016] [error] [client 66.249.66.130] FastCGI: server "/usr/sbin/php-fpm-edenhogar.com" stderr: PHP message: PHP Warning: preg_replace(): Compilation failed: invalid range in character class at offset 24 in /var/www/vhosts/edenhogar.com/httpdocs/classes/Tools.php on line 1079
[Thu Feb 04 09:53:41 2016] [error] [client 66.249.66.130] FastCGI: server "/usr/sbin/php-fpm-edenhogar.com" stderr: PHP message: PHP Warning: preg_replace(): Compilation failed: invalid range in character class at offset 24 in /var/www/vhosts/edenhogar.com/httpdocs/classes/Tools.php on line 1079
[Thu Feb 04 09:53:41 2016] [error] [client 66.249.66.130] FastCGI: server "/usr/sbin/php-fpm-edenhogar.com" stderr: PHP message: PHP Warning: preg_replace(): Compilation failed: invalid range in character class at offset 24 in /var/www/vhosts/edenhogar.com/httpdocs/classes/Tools.php on line 1079

 

 

¿alguien me puede decir por que se debe esto ?

Link to comment
Share on other sites

Si no fuese así no te lo habría mencionado. Si, lo creo

 

Se trataría pues de hacer lo que dice

 

https://github.com/PrestaShop/PrestaShop/commit/4c6ca7cf12fb73818544e61a05d87ce9fd83919c

 

Esto es substituir el método que esta en classes/Tools.php en la linea aprox. 1079 por el siguiente

	public static function str2url($str)
	{
		static $allow_accented_chars = null;
		if ($allow_accented_chars === null)
			$allow_accented_chars = Configuration::get('PS_ALLOW_ACCENTED_CHARS_URL');
		$str = trim($str);
		if (function_exists('mb_strtolower'))
			$str = mb_strtolower($str, 'utf-8');
		if (!$allow_accented_chars)
			$str = Tools::replaceAccentedChars($str);
		// Remove all non-whitelist chars.
		if ($allow_accented_chars)
			$str = preg_replace('/[^a-zA-Z0-9\s\'\:\/\[\]\-\pL]/u', '', $str);
		else
			$str = preg_replace('/[^a-zA-Z0-9\s\'\:\/\[\]\-]/','', $str);
		$str = preg_replace('/[\s\'\:\/\[\]\-]+/', ' ', $str);
		$str = str_replace(array(' ', '/'), '-', $str);
		// If it was not possible to lowercase the string with mb_strtolower, we do it after the transformations.
		// This way we lose fewer special chars.
		if (!function_exists('mb_strtolower'))
			$str = Tools::strtolower($str);
		return $str;
	}

Haces una copia del fichero antes y si tienes cualquier problema lo reemplazas. Toda precaución es poca, y si no lo ves claro no lo hagas (puedes encargarselo a un profesional, pero vamos es facil)

Link to comment
Share on other sites

He comparado los dos textos, el que tenia Tools.php y el que me has pasado y solo cambia la parte del final,

 

// This way we lose fewer special chars.
        if (!function_exists('mb_strtolower'))
            $str = Tools::strtolower($str);
        return $str;
    }

 

se añade la palabra "TOOLS" en esa función

 

Lo he subido y todo sigue normal, espero que se soluciones el problema. voy a avisar a mi hosting para que borre el log por si tiene algunos de estos errores que hayan generado a lo largo del dia y le preguntare dentro de un tiempo haber si estos siguen o no apareciendo.

 

Muchas gracias por la ayuda, pensaba que esto eran uno de esos problemas que nunca se solucionarían  

Link to comment
Share on other sites

He comparado los dos textos, el que tenia Tools.php y el que me has pasado y solo cambia la parte del final,

 

// This way we lose fewer special chars.

        if (!function_exists('mb_strtolower'))

            $str = Tools::strtolower($str);

        return $str;

    }

 

se añade la palabra "TOOLS" en esa función

 

Lo he subido y todo sigue normal, espero que se soluciones el problema. voy a avisar a mi hosting para que borre el log por si tiene algunos de estos errores que hayan generado a lo largo del dia y le preguntare dentro de un tiempo haber si estos siguen o no apareciendo.

 

Muchas gracias por la ayuda, pensaba que esto eran uno de esos problemas que nunca se solucionarían  

 

Es posible que en la 1.5.6.2 no existiese Tools::strtolower($str); y por eso llame a strtolower($str);

 

lo importante es la barrita invertida

 

if ($allow_accented_chars)

            $str = preg_replace('/[^a-zA-Z0-9\s\'\:\/\[\]\-\pL]/u', '', $str);

        else

            $str = preg_replace('/[^a-zA-Z0-9\s\'\:\/\[\]\-]/','', $str);

 

Entonces en tu caso

 

public static function str2url($str)

    {

        static $allow_accented_chars = null;

        if ($allow_accented_chars === null)

            $allow_accented_chars = Configuration::get('PS_ALLOW_ACCENTED_CHARS_URL');

        $str = trim($str);

        if (function_exists('mb_strtolower'))

            $str = mb_strtolower($str, 'utf-8');

        if (!$allow_accented_chars)

            $str = Tools::replaceAccentedChars($str);

        // Remove all non-whitelist chars.

        if ($allow_accented_chars)

            $str = preg_replace('/[^a-zA-Z0-9\s\'\:\/\[\]\-\pL]/u', '', $str);

        else

            $str = preg_replace('/[^a-zA-Z0-9\s\'\:\/\[\]\-]/','', $str);

        $str = preg_replace('/[\s\'\:\/\[\]\-]+/', ' ', $str);

        $str = str_replace(array(' ', '/'), '-', $str);

        // If it was not possible to lowercase the string with mb_strtolower, we do it after the transformations.

        // This way we lose fewer special chars.

        if (!function_exists('mb_strtolower'))

           $str = strtolower($str);

        return $str;

    }

Link to comment
Share on other sites

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