vickthikor Posted February 4, 2016 Share Posted February 4, 2016 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 More sharing options...
FranIFS Posted February 4, 2016 Share Posted February 4, 2016 FastCGI ¿en qué versión? ¿Y prestashop? Es un servidor virtual o algo similar ¿no? Lo ideal es que contactes con el proveedor. Link to comment Share on other sites More sharing options...
Enrique Gómez Posted February 5, 2016 Share Posted February 5, 2016 Se trata de warnings que no son malos per se, pero llenan el hosting de logs. Esta soluconado en http://forge.prestashop.com/browse/PSCSX-2755 mira de aplicar https://github.com/PrestaShop/PrestaShop/commit/4c6ca7cf12fb73818544e61a05d87ce9fd83919c Link to comment Share on other sites More sharing options...
vickthikor Posted February 5, 2016 Author Share Posted February 5, 2016 Gracias por vuestras respuestas, estoy utilizando prestashop 1.5.6, voy ha echarle un vistazo a los link que me has dejado y ahora te comento. Link to comment Share on other sites More sharing options...
vickthikor Posted February 5, 2016 Author Share Posted February 5, 2016 ¿Crees que añadiendo ese código en el archivo tools.php sera suficiente para que ese error se elimine? Link to comment Share on other sites More sharing options...
Enrique Gómez Posted February 5, 2016 Share Posted February 5, 2016 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 More sharing options...
vickthikor Posted February 5, 2016 Author Share Posted February 5, 2016 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 More sharing options...
Enrique Gómez Posted February 5, 2016 Share Posted February 5, 2016 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 More sharing options...
Recommended Posts