View previous topic :: View next topic |
Author |
Message |
Dana Smarty Rookie
Joined: 13 May 2014 Posts: 5
|
Posted: Tue May 13, 2014 2:29 pm Post subject: weird behaviour of smarty-enabled prestashop |
|
|
Hello
I'm running a the latest version of prestashop (1.6.0) using smarty
Sometimes, I run into a fatal error and page crashes. After refreshing, sometimes the content is displayed correctly but after the next refresh, the fatal error appears again:
Fatal error: Call to undefined function smarty_function_counter() in /var/home/creative/public_html/prestashop/cache/smarty/compile/64/07/0c/64070c9e2a16ec22a9787505a8ff909c28d1654f.file.blockcart.tpl.php on line 330
Other examples are
Fatal error: Call to undefined function smarty_modifier_regex_replace() in /var/home/creative/public_html/prestashop/cache/smarty/compile/eb/c4/1c/ebc41c914e2c3f1aa8e5f143e7d78cc84ddc7c6c.file.list_content.tpl.php on line 280
or
Fatal error: Call to undefined function smarty_modifier_replace() in /var/home/creative/public_html/prestashop/cache/smarty/compile/eb/c4/1c/ebc41c914e2c3f1aa8e5f143e7d78cc84ddc7c6c.file.list_content.tpl.php on line 280
All 3 files modifier.replace.php, modifier.regex_replace.php and function.counter.php are in place and files permissions are now 777
Did anyone else encounter this problem ? Does anybody have a hint ?
Any help is highly appreciated
[/img] |
|
Back to top |
|
mohrt Administrator
Joined: 16 Apr 2003 Posts: 7368 Location: Lincoln Nebraska, USA
|
Posted: Tue May 13, 2014 10:42 pm Post subject: |
|
|
Is the problem intermittent or consistent? It appears that the plugins are not (always) accessible/readable. Are the files accessed over a shared file system? |
|
Back to top |
|
Dana Smarty Rookie
Joined: 13 May 2014 Posts: 5
|
Posted: Wed May 14, 2014 5:36 am Post subject: |
|
|
Hi Monte
The problem is intermittent and not related to any change I make in back-end.
The files are accessed over a shared file system
Thank you in advance
Dana |
|
Back to top |
|
Dana Smarty Rookie
Joined: 13 May 2014 Posts: 5
|
Posted: Thu May 15, 2014 9:18 am Post subject: |
|
|
Hello again,
As I move on with the problem, I started changing the compiled template
So in order to address the error
[15-May-2014 11:21:06 Europe/Bucharest] PHP Fatal error: Call to undefined function smarty_function_counter() in /var/home/datanetw/public_html/cache/smarty/compile/0e/43/dc/0e43dc05a802348ebc691d30cce30e3ab0590acf.file.blockcart.tpl.php on line 533
in 0e43dc05a802348ebc691d30cce30e3ab0590acf.file.blockcart.tpl.php I added
<?php
echo file_get_contents('/var/home/datanetw/public_html/tools/smarty/plugins/function.counter.php');
echo "<br/>";
var_dump(is_callable('smarty_function_counter'));
?>
right after
if (!is_callable('smarty_function_counter')) include '/var/home/datanetw/public_html/tools/smarty/plugins/function.counter.php';
?>
It appears that in all cases file_get_contents gets the function.counter.php correctly. When the normal page content is correctly loaded the result of is_callable is bool(true) while when the fatal error appears the result is bool(false)
Any hint about a function not being callable, even if the file_get_contents is available ?
Thank you in advance
Dana |
|
Back to top |
|
mohrt Administrator
Joined: 16 Apr 2003 Posts: 7368 Location: Lincoln Nebraska, USA
|
Posted: Thu May 15, 2014 1:22 pm Post subject: |
|
|
are there any errors in the php log files that indicate the include() did not work? there has to be an intermittent file access issue here. Do you have another environment to test on? |
|
Back to top |
|
Dana Smarty Rookie
Joined: 13 May 2014 Posts: 5
|
Posted: Fri May 16, 2014 6:19 am Post subject: |
|
|
Hi Monte
There are no warnings in error_log about include() failing.
However, error_reporting is E_ALL | E_STRICT (as of php 5.3.25) and when trying to include a non-existing 'aaa_aaa' file I get the right warning
[16-May-2014 09:03:50 Europe/Bucharest] PHP Warning: include() [<a href='function.include'>function.include</a>]: Failed opening '/var/home/datanetw/public_html/tools/smarty/plugins/function.aaa_aaa.php' for inclusion (include_path='.:/usr/lib/php:/usr/local/lib/php') in /var/home/datanetw/public_html/cache/smarty/compile/d4/40/d1/d440d11f5f97dc4b682870c6b05b01528fad95b1.file.blockcontactinfos.tpl.php on line 30
The error I have "PHP Fatal error: Call to undefined function ..." leads me to the conclusion that the smarty plugins are included in the compiled templates, but somehow they are not callable / usable.
Any hint ?
Thank you
Dana |
|
Back to top |
|
Dana Smarty Rookie
Joined: 13 May 2014 Posts: 5
|
Posted: Wed May 28, 2014 8:09 pm Post subject: |
|
|
Hi Monte,
I'm writing this post for future reference, so if someone else encounters the same problem, they do not spend the time I spent on this
I took your second advice and changed the hosting provider - for the second one everything worked ok right from the beginning.
Then I compared (phpinfo) the 2 environments. In the end, the cause proved to be eAccelerator enabled on the first provider server. When disabled, everything worked just great
So, I would in no circumstance use a prestashop 1.6.0 enabled website on an eAccelerator 0.9.6.1 enabled webserver, for reasons that are now unclear to me and I don't have access to inspect
In the end, thank you for your help and your hints
Dana |
|
Back to top |
|
|