butlerov Posted August 20, 2017 Share Posted August 20, 2017 (edited) Hi.After update from 1.6.1.2 to 1.6.1.16 some strange warnings starts appears Only on some ip How to fix them?manually delete clear cache folders ? Please help.Thanks [Sun Aug 20 14:06:52.212376 2017] [:error] [pid 27737] [client 192.151.158.146:51974] PHP Warning: scandir(/var/www/domains/domainname.ru/themes/default-bootstrap/cache/ie9): failed to open dir: No such file or directory in /var/www/domains/domainname.ru/classes/Media.php on line 628 [Sun Aug 20 14:06:52.212458 2017] [:error] [pid 27737] [client 192.151.158.146:51974] PHP Warning: scandir(): (errno 2): No such file or directory in /var/www/domains/domainname.ru/classes/Media.php on line 628 [Sun Aug 20 14:06:52.212473 2017] [:error] [pid 27737] [client 192.151.158.146:51974] PHP Warning: array_diff(): Argument #1 is not an array in /var/www/domains/domainname.ru/classes/Media.php on line 628 [Sun Aug 20 14:06:52.212480 2017] [:error] [pid 27737] [client 192.151.158.146:51974] PHP Warning: Invalid argument supplied for foreach() in /var/www/domains/domainname.ru/classes/Media.php on line 628 [Sun Aug 20 14:06:52.228690 2017] [:error] [pid 27737] [client 192.151.158.146:51974] PHP Warning: htmlspecialchars() expects parameter 1 to be string, array given in /var/www/domains/domainname.ru/cache/smarty/compile/11/b3/e4/11b3e41194d45743198bd5ee23976134dd28269d.file.header.tpl.php on line 107 Looks like all new visitors generate those warnings, but my visits for example did not [Sun Aug 20 17:23:36.104948 2017] [:error] [pid 28539] [client 91.204.252.230:45680] PHP Warning: scandir(/var/www/domains/domainname.ru/themes/default-bootstrap/cache/ie9): failed to open dir: No such file or directory in /var/www/domains/domainname.ru/classes/Media.php on line 628, referer: http://domainname.ru/fresco/72-tumba-fresco-80-10612.html [Sun Aug 20 17:23:36.105010 2017] [:error] [pid 28539] [client 91.204.252.230:45680] PHP Warning: scandir(): (errno 2): No such file or directory in /var/www/domains/domainname.ru/classes/Media.php on line 628, referer: http://domainname.ru/fresco/72-tumba-fresco-80-10612.html [Sun Aug 20 17:23:36.105027 2017] [:error] [pid 28539] [client 91.204.252.230:45680] PHP Warning: array_diff(): Argument #1 is not an array in /var/www/domains/domainname.ru/classes/Media.php on line 628, referer: http://domainname.ru/fresco/72-tumba-fresco-80-10612.html [Sun Aug 20 17:23:36.105032 2017] [:error] [pid 28539] [client 91.204.252.230:45680] PHP Warning: Invalid argument supplied for foreach() in /var/www/domains/domainname.ru/classes/Media.php on line 628, referer: http://domainname.ru/fresco/72-tumba-fresco-80-10612.html [Sun Aug 20 17:23:36.123627 2017] [:error] [pid 28539] [client 91.204.252.230:45680] PHP Warning: htmlspecialchars() expects parameter 1 to be string, array given in /var/www/domains/domainname.ru/cache/smarty/compile/11/b3/e4/11b3e41194d45743198bd5ee23976134dd28269d.file.header.tpl.php on line 107, referer: http://domainname.ru/fresco/72-tumba-fresco-80-10612.html Edited August 20, 2017 by butlerov (see edit history) Link to comment Share on other sites More sharing options...
Scully Posted August 20, 2017 Share Posted August 20, 2017 Try to create this directory manually: /default-bootstrap/cache/ie9 The function which throws the error is intended to split CSS files into multiple for IE9 browser. Link to comment Share on other sites More sharing options...
Scully Posted August 23, 2017 Share Posted August 23, 2017 Some feedback would be appreciated. Link to comment Share on other sites More sharing options...
butlerov Posted September 7, 2017 Author Share Posted September 7, 2017 (edited) Try to create this directory manually: /default-bootstrap/cache/ie9 The function which throws the error is intended to split CSS files into multiple for IE9 browser. Looks like smarty create this directory again after some cache cleaning, so no more this errors, thanks, only PHP Warning: htmlspecialchars() expects parameter 1 to be string, array given in /var/www/domains/domainname.ru/cache/smarty/compile/11/b3/e4/11b3e41194d45743198bd5ee23976134dd28269d.file.header.tpl.php on line 107 line 107.My visits didn't trigger that errors so maybe it's some bots 106 <link rel="stylesheet" href="<?php echo htmlspecialchars($_smarty_tpl->tpl_vars['css_uri']->value, ENT_QUOTES, 'UTF-8', true);?> 107 " type="text/css" media="<?php echo htmlspecialchars($_smarty_tpl->tpl_vars['media']->value, ENT_QUOTES, 'UTF-8', true);?> 108 " /> and other errors but some strange, today's happened in the morning [Thu Sep 07 08:09:39.768893 2017] [:error] [pid 24324] [client 95.68.252.232:51625] PHP Warning: PDO::query(): MySQL server has gone away in /var/www/domains/domainname.ru/classes/db/DbPDO.php on line 134, referer: https://www.domainname.ru/73-categoryname [Thu Sep 07 08:09:39.768981 2017] [:error] [pid 24324] [client 95.68.252.232:51625] PHP Warning: PDO::query(): Error reading result set's header in /var/www/domains/domainname.ru/classes/db/DbPDO.php on line 134, referer: https://www.domainname.ru/73-categoryname [Thu Sep 07 08:09:39.768954 2017] [:error] [pid 23454] [client 95.68.252.232:51639] PHP Warning: PDO::query(): MySQL server has gone away in /var/www/domains/domainname.ru/classes/db/DbPDO.php on line 134, referer: https://www.domainname.ru/73-categoryname [Thu Sep 07 08:09:39.769004 2017] [:error] [pid 23454] [client 95.68.252.232:51639] PHP Warning: PDO::query(): Error reading result set's header in /var/www/domains/domainname.ru/classes/db/DbPDO.php on line 134, referer: https://www.domainname.ru/73-categoryname [Thu Sep 07 08:09:39.769158 2017] [:error] [pid 24323] [client 95.68.252.232:51627] PHP Warning: PDO::query(): MySQL server has gone away in /var/www/domains/domainname.ru/classes/db/DbPDO.php on line 134, referer: https://www.domainname.ru/73-categoryname [Thu Sep 07 08:09:39.769200 2017] [:error] [pid 24323] [client 95.68.252.232:51627] PHP Warning: PDO::query(): Error reading result set's header in /var/www/domains/domainname.ru/classes/db/DbPDO.php on line 134, referer: https://www.domainname.ru/73-categoryname [Thu Sep 07 08:09:39.769541 2017] [:error] [pid 24344] [client 95.68.252.232:51657] PHP Warning: PDO::query(): MySQL server has gone away in /var/www/domains/domainname.ru/classes/db/DbPDO.php on line 134, referer: https://www.domainname.ru/73-categoryname [Thu Sep 07 08:09:39.769587 2017] [:error] [pid 24344] [client 95.68.252.232:51657] PHP Warning: PDO::query(): Error reading result set's header in /var/www/domains/domainname.ru/classes/db/DbPDO.php on line 134, referer: https://www.domainname.ru/73-categoryname [Thu Sep 07 08:09:39.769578 2017] [:error] [pid 24210] [client 95.68.252.232:51629] PHP Warning: PDO::query(): MySQL server has gone away in /var/www/domains/domainname.ru/classes/db/DbPDO.php on line 134, referer: https://www.domainname.ru/73-categoryname [Thu Sep 07 08:09:39.769621 2017] [:error] [pid 24210] [client 95.68.252.232:51629] PHP Warning: PDO::query(): Error reading result set's header in /var/www/domains/domainname.ru/classes/db/DbPDO.php on line 134, referer: https://www.domainname.ru/73-categoryname [Thu Sep 07 08:09:39.769851 2017] [:error] [pid 24061] [client 95.68.252.232:51631] PHP Warning: PDO::query(): MySQL server has gone away in /var/www/domains/domainname.ru/classes/db/DbPDO.php on line 134, referer: https://www.domainname.ru/73-categoryname [Thu Sep 07 08:09:39.769893 2017] [:error] [pid 24061] [client 95.68.252.232:51631] PHP Warning: PDO::query(): Error reading result set's header in /var/www/domains/domainname.ru/classes/db/DbPDO.php on line 134, referer: https://www.domainname.ru/73-categoryname [Thu Sep 07 08:09:39.770057 2017] [:error] [pid 24325] [client 95.68.252.232:51621] PHP Warning: PDO::query(): MySQL server has gone away in /var/www/domains/domainname.ru/classes/db/DbPDO.php on line 134, referer: https://www.domainname.ru/73-categoryname [Thu Sep 07 08:09:39.770107 2017] [:error] [pid 24325] [client 95.68.252.232:51621] PHP Warning: PDO::query(): Error reading result set's header in /var/www/domains/domainname.ru/classes/db/DbPDO.php on line 134, referer: https://www.domainname.ru/73-categoryname [Thu Sep 07 08:09:39.770282 2017] [:error] [pid 24338] [client 95.68.252.232:51653] PHP Warning: PDO::query(): MySQL server has gone away in /var/www/domains/domainname.ru/classes/db/DbPDO.php on line 134, referer: https://www.domainname.ru/73-categoryname [Thu Sep 07 08:09:39.770320 2017] [:error] [pid 24338] [client 95.68.252.232:51653] PHP Warning: PDO::query(): Error reading result set's header in /var/www/domains/domainname.ru/classes/db/DbPDO.php on line 134, referer: https://www.domainname.ru/73-categoryname [Thu Sep 07 08:09:39.770725 2017] [:error] [pid 24342] [client 95.68.252.232:51655] PHP Warning: PDO::query(): MySQL server has gone away in /var/www/domains/domainname.ru/classes/db/DbPDO.php on line 134, referer: https://www.domainname.ru/73-categoryname [Thu Sep 07 08:09:39.770765 2017] [:error] [pid 24342] [client 95.68.252.232:51655] PHP Warning: PDO::query(): Error reading result set's header in /var/www/domains/domainname.ru/classes/db/DbPDO.php on line 134, referer: https://www.domainname.ru/73-categoryname [Thu Sep 07 08:09:39.770837 2017] [:error] [pid 24336] [client 95.68.252.232:51651] PHP Warning: PDO::query(): MySQL server has gone away in /var/www/domains/domainname.ru/classes/db/DbPDO.php on line 134, referer: https://www.domainname.ru/73-categoryname [Thu Sep 07 08:09:39.770874 2017] [:error] [pid 24336] [client 95.68.252.232:51651] PHP Warning: PDO::query(): Error reading result set's header in /var/www/domains/domainname.ru/classes/db/DbPDO.php on line 134, referer: https://www.domainname.ru/73-categoryname [Thu Sep 07 08:09:39.771280 2017] [:error] [pid 23839] [client 95.68.252.232:51617] PHP Warning: PDO::query(): MySQL server has gone away in /var/www/domains/domainname.ru/classes/db/DbPDO.php on line 134, referer: https://www.domainname.ru/73-categoryname [Thu Sep 07 08:09:39.771323 2017] [:error] [pid 23839] [client 95.68.252.232:51617] PHP Warning: PDO::query(): Error reading result set's header in /var/www/domains/domainname.ru/classes/db/DbPDO.php on line 134, referer: https://www.domainname.ru/73-categoryname [Thu Sep 07 08:09:39.770448 2017] [:error] [pid 24191] [client 95.68.252.232:51636] PHP Warning: PDO::query(): MySQL server has gone away in /var/www/domains/domainname.ru/classes/db/DbPDO.php on line 134, referer: https://www.domainname.ru/73-categoryname [Thu Sep 07 08:09:39.771441 2017] [:error] [pid 24191] [client 95.68.252.232:51636] PHP Warning: PDO::query(): Error reading result set's header in /var/www/domains/domainname.ru/classes/db/DbPDO.php on line 134, referer: https://www.domainname.ru/73-categoryname [Thu Sep 07 08:09:40.486450 2017] [:error] [pid 24345] [client 95.68.252.232:51659] PHP Warning: Error while sending QUERY packet. PID=24345 in /var/www/domains/domainname.ru/classes/db/DbPDO.php on line 134, referer: https://www.domainname.ru/73-categoryname [Thu Sep 07 08:09:41.188990 2017] [:error] [pid 23253] [client 95.68.252.232:51615] PHP Warning: Error while sending QUERY packet. PID=23253 in /var/www/domains/domainname.ru/classes/db/DbPDO.php on line 134, referer: https://www.domainname.ru/73-categoryname Edited September 7, 2017 by butlerov (see edit history) Link to comment Share on other sites More sharing options...
Scully Posted September 7, 2017 Share Posted September 7, 2017 Restart your server or at least your mySQL process. Link to comment Share on other sites More sharing options...
mmsh Posted December 25, 2017 Share Posted December 25, 2017 Hello, have you found the cause of PHP Warning: htmlspecialchars() expects parameter 1 to be string, array given in /.file.header.tpl.php where css_uri and media ??? Thanks Link to comment Share on other sites More sharing options...
Gu1llaume Posted March 8, 2019 Share Posted March 8, 2019 Hello, Have ou solve this issue ? I've many error like this with Prestashop 1.6.1.20 mod_fcgid: stderr: PHP Warning: htmlspecialchars() expects parameter 1 to be string, array given in /web/cache/smarty/compile/ce/89/fb/ce89fb9c2aacf04c01f426b748f947686de0a91a.file.header.tpl.php on line 116 line 116 115 <link rel="stylesheet" href="<?php echo htmlspecialchars($_smarty_tpl->tpl_vars['css_uri']->value, ENT_QUOTES, 'UTF-8', true);?> 116 " type="text/css" media="<?php echo htmlspecialchars($_smarty_tpl->tpl_vars['media']->value, ENT_QUOTES, 'UTF-8', true);?> 117 " /> Thanks Link to comment Share on other sites More sharing options...
butlerov Posted March 8, 2019 Author Share Posted March 8, 2019 2 hours ago, Gu1llaume said: Have ou solve this issue ? Hi.Unfortunately, no.Still getting those warnings. [Fri Mar 08 14:51:06.764704 2019] [:error] [pid 11970] [client 5.135.164.72:45012] PHP Warning: htmlspecialchars() expects parameter 1 to be string, array given in /var/www/domains/domainname.ru/cache/smarty/compile/11/b3/e4/11b3e41194d45743198bd5ee23976134dd28269d.file.header.tpl.php on line 107 <link rel="stylesheet" href="<?php echo htmlspecialchars($_smarty_tpl->tpl_vars['css_uri']->value, ENT_QUOTES, 'UTF-8', true);?> " type="text/css" media="<?php echo htmlspecialchars($_smarty_tpl->tpl_vars['media']->value, ENT_QUOTES, 'UTF-8', true);?> Link to comment Share on other sites More sharing options...
Gu1llaume Posted March 8, 2019 Share Posted March 8, 2019 (edited) Ok, I've found the solution. This problem happens with ie8 users ... Our theme is not up to date... in header.tpl change {if isset($css_files)} {foreach from=$css_files key=css_uri item=media} <link rel="stylesheet" href="{$css_uri|escape:'html':'UTF-8'}" type="text/css" media="{$media|escape:'html':'UTF-8'}" /> {/foreach} {/if} with (I've found it here ; https://github.com/PrestaShop/PrestaShop/blob/1.6.1.x/themes/default-bootstrap/header.tpl) {if isset($css_files)} {foreach from=$css_files key=css_uri item=media} {if $css_uri == 'lteIE9'} <!--[if lte IE 9]> {foreach from=$css_files[$css_uri] key=css_uriie9 item=mediaie9} <link rel="stylesheet" href="{$css_uriie9|escape:'html':'UTF-8'}" type="text/css" media="{$mediaie9|escape:'html':'UTF-8'}" /> {/foreach} <![endif]--> {else} <link rel="stylesheet" href="{$css_uri|escape:'html':'UTF-8'}" type="text/css" media="{$media|escape:'html':'UTF-8'}" /> {/if} {/foreach} {/if} Edited March 8, 2019 by Gu1llaume (see edit history) Link to comment Share on other sites More sharing options...
Gu1llaume Posted March 8, 2019 Share Posted March 8, 2019 You can check with User-Agent Switcher for Chrome ! It work well Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now