Smarty Forum Index Smarty
WARNING: All discussion is moving to https://reddit.com/r/smarty, please go there! This forum will be closing soon.

Strange compile error giving PHP fatal error

 
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    Smarty Forum Index -> General
View previous topic :: View next topic  
Author Message
Agravayne
Smarty n00b


Joined: 27 Oct 2014
Posts: 3

PostPosted: Mon Oct 27, 2014 1:33 pm    Post subject: Strange compile error giving PHP fatal error Reply with quote

Hello
I have a strange, intermittent compile problem. at least I think it is a problem with the compiling.

We occasionally get this kind of entry in the error logs

Quote:
[Sat Oct 25 14:51:21 2014] [error] [client 31.193.8.79] PHP Fatal error: Call to undefined function smarty_modifier_kilometresToMiles() in /tmp/axTemplater/apache/sitename.com/11/6a/47/116a47679bd6dd0cdb7013d44b8f9ceac53cdbbb.file.GridData.tpl.php on line 187, referer:
[Sat Oct 25 14:51:21 2014] [error] [client 31.193.8.79] PHP Stack trace:, referer:
[Sat Oct 25 14:51:21 2014] [error] [client 31.193.8.79] PHP 1. {main}() /var/www/vhosts/sitename.com/htdocs/index.php:0, referer:
[Sat Oct 25 14:51:21 2014] [error] [client 31.193.8.79] PHP 2. Axscend_WebFramework->run() /var/www/vhosts/sitename.com/htdocs/index.php:11, referer
[Sat Oct 25 14:51:21 2014] [error] [client 31.193.8.79] PHP 3. Axscend_WebFramework->doRequest() /var/www/vhosts/axscend/common/php/lib/Axscend/WebFramework.inc:72, referer:
[Sat Oct 25 14:51:21 2014] [error] [client 31.193.8.79] PHP 4. Axscend_WebFramework_V_Smarty->display() /var/www/vhosts/axscend/common/php/lib/Axscend/WebFramework.inc:162, referer:
[Sat Oct 25 14:51:21 2014] [error] [client 31.193.8.79] PHP 5. Smarty_Internal_TemplateBase->fetch() /var/www/vhosts/axscend/common/php/lib/Axscend/WebFramework/V/Smarty.inc:43, referer:
[Sat Oct 25 14:51:21 2014] [error] [client 31.193.8.79] PHP 6. content_544baad91075b() /var/www/vhosts/axscend/common/php/lib/Smarty/sysplugins/smarty_internal_templatebase.php:176, referer:
[Sat Oct 25 14:51:21 2014] [error] [client 31.193.8.79] PHP 7. Smarty_Internal_Template->getSubTemplate() /tmp/axTemplater/apache/sitename.com/da/69/bf/da69bfa06c2d4d68e5e68bbd93297f9b8cdca169.file.wrapper.tpl.php:287, referer:
[Sat Oct 25 14:51:21 2014] [error] [client 31.193.8.79] PHP 8. Smarty_Internal_TemplateBase->fetch() /var/www/vhosts/axscend/common/php/lib/Smarty/sysplugins/smarty_internal_template.php:278, referer:
[Sat Oct 25 14:51:21 2014] [error] [client 31.193.8.79] PHP 9. content_544baad994fe3() /var/www/vhosts/axscend/common/php/lib/Smarty/sysplugins/smarty_internal_templatebase.php:176, referer:


You can see the PHP Fatal error: Call to undefined function smarty_modifier_kilometresToMiles() This changes each time it occurs. i.e. its making a call to a different function when it happens.
I cleared the compile directory and switched off caching. When I tried the same page again then exactly the same file reappeared in the compile directory? With the same errors? After about a day the problem went away.

We have two servers both running the same code and it was only happening on one server. They are both identical (in a load balanced cluster).
I am at a bit of a loss as to where to start even looking at this? If it were a problem with the template or the data being put in it then surely it would happen on both servers the same?

Anyone got any ideas or pointers? I have googled extensively but can't find anything. Its concerning as it brought down the site for a few hours - luckily out of hours and not knowing why - I can't guarantee it won't do it again.
Back to top
View user's profile Send private message
mohrt
Administrator


Joined: 16 Apr 2003
Posts: 7368
Location: Lincoln Nebraska, USA

PostPosted: Mon Oct 27, 2014 5:50 pm    Post subject: Reply with quote

Where does the modifier kilometresToMiles live? In the plugins folder as a file, or in the code as a registered plugin? It could be the plugin is not registered at the time it is called. If it is autoloaded from the plugins folder, be sure the file has correct read permissions and the folder is in your plugins path.
Back to top
View user's profile Send private message Visit poster's website
Agravayne
Smarty n00b


Joined: 27 Oct 2014
Posts: 3

PostPosted: Tue Oct 28, 2014 10:35 am    Post subject: Reply with quote

The modifier is in the SmartyContribPlugins folder and has the correct permissions. If not then surely the error would occur always and not intermittently?
Back to top
View user's profile Send private message
Agravayne
Smarty n00b


Joined: 27 Oct 2014
Posts: 3

PostPosted: Fri Nov 14, 2014 3:17 pm    Post subject: Any more ideas? Reply with quote

It just happened to us again on a call to a different function. Oddly if I clear the cache and cookies on my browser and restart my machine it is ok. But then I think once I do that I am switched over to using the other server, which works fine. It requires a restart of the machine - simply clearing the cache and cookies and restarting the browser does not work.

So what I think is happening is something is gong wrong when compiling the file. That file keeps getting compiled wrong on that server but not the other one?

I have a copy of the problem file if that would help.
Back to top
View user's profile Send private message
U.Tews
Administrator


Joined: 22 Nov 2006
Posts: 5068
Location: Hamburg / Germany

PostPosted: Fri Nov 14, 2014 7:29 pm    Post subject: Reply with quote

Is it possible that the realpath of the SmartyContribPlugins folder looks different on both servers?

With the compilation Smarty does save the realpath for the plugin and does use it lateron to include the plugin.
Back to top
View user's profile Send private message
Display posts from previous:   
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    Smarty Forum Index -> General All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group
Protected by Anti-Spam ACP