PrestaShop错误500 PREG_BACKTRACK_LIMIT_ERROR

时间:2018-03-05 19:28:26

标签: php web prestashop

我在PrestaShop的网站上遇到了问题。 在我将产品添加到比较并跟随page的链接后,它显示500服务器错误。在服务器日志中:

ERROR: PREG_BACKTRACK_LIMIT_ERROR in function packJSinHTML, referer: https://svdd.ru/products-comparison

PHP Notice:  Undefined index: search_query in /var/www/svddru/data/www/svdd.ru/cache/smarty/compile/9e/0b/2e/9e0b2eed3cabe548854f824a36411cf7b41c2feb.file.blocksearch-top.tpl.php on line 37, referer: https://svdd.ru/products-comparison

PHP Notice:  Trying to get property of non-object in /var/www/svddru/data/www/svdd.ru/cache/smarty/compile/9e/0b/2e/9e0b2eed3cabe548854f824a36411cf7b41c2feb.file.blocksearch-top.tpl.php on line 37, referer: https://svdd.ru/products-comparison

PHP Notice:  Undefined index: ajax_allowed in /var/www/svddru/data/www/svdd.ru/cache/smarty/compile/ed/74/9d/ed749d2af11acf978d4f6deb923e55d40a3b9d12.file.blockcart.tpl.php on line 86, referer: https://svdd.ru/products-comparison

PHP Notice:  Trying to get property of non-object in /var/www/svddru/data/www/svdd.ru/cache/smarty/compile/ed/74/9d/ed749d2af11acf978d4f6deb923e55d40a3b9d12.file.blockcart.tpl.php on line 86, referer: https://svdd.ru/products-comparison

PHP Fatal error:  Cannot use object of type Product as array in /var/www/svddru/data/www/svdd.ru/cache/smarty/compile/ed/74/9d/ed749d2af11acf978d4f6deb923e55d40a3b9d12.file.blockcart.tpl.php on line 121, referer: https://svdd.ru/products-comparison

在控制台日志中:

jquery-1.11.0.min.js:169 Uncaught ReferenceError: FancyboxI18nClose is not defined at HTMLDocument.<anonymous> (jquery-1.11.0.min.js:169) at j (jquery-1.11.0.min.js:2) at Object.fireWith [as resolveWith] (jquery-1.11.0.min.js:2) at Function.ready (jquery-1.11.0.min.js:2) at HTMLDocument.K (jquery-1.11.0.min.js:2)

差不多一个月我无法理解什么是错的。提前感谢您的回答!

1 个答案:

答案 0 :(得分:0)

此函数抛出此错误:

 val eptable = 
 sc.cassandraTable("test","devices").select("device_ccompany","device_model","devi
 ce_type")

问题似乎是public static function packJSinHTML($html_content) { if (strlen($html_content) > 0) { $html_content_copy = $html_content; if (!preg_match('/'.Media::$pattern_keepinline.'/', $html_content)) { $html_content = preg_replace_callback( Media::$pattern_js, array('Media', 'packJSinHTMLpregCallback'), $html_content, Media::getBackTrackLimit()); // If the string is too big preg_replace return an error // In this case, we don't compress the content if (function_exists('preg_last_error') && preg_last_error() == PREG_BACKTRACK_LIMIT_ERROR) { if (_PS_MODE_DEV_) { Tools::error_log('ERROR: PREG_BACKTRACK_LIMIT_ERROR in function packJSinHTML'); } return $html_content_copy; } } return $html_content; } return false; } 的内容太大了。因此,您可以尝试将preg_replace值增加到pcre.backtrack_limit

您也可以覆盖此功能并注释掉这些行:

1000000000