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

Smarty 2 require_once core.load_plugins failing

 
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
dmitryg
Smarty Rookie


Joined: 06 Nov 2013
Posts: 5

PostPosted: Thu Nov 07, 2013 7:06 pm    Post subject: Smarty 2 require_once core.load_plugins failing Reply with quote

I have been asked to check a website that uses Smarty which stopped working, after working ok for years.

I updated Smarty to be newest Smarty 2 version, but error persists. Site now using 2.6.28 .

The problem is in /admin section of a site.

The page displays a template home, which in turn includes template main.tpl, which in turn includes template display_tools.tpl . The script dies without error at top of this display_tools.tpl.

The first line of the template reads:

include_once(SMARTY_CORE_DIR . 'core.load_plugins.php');

That's where it dies. It is very strange. If I comment out this line in the compiled template, for testing, then it dies in the next line smarty_core_load_plugins(...)

When I say it dies, it is not that I see a blank page or an error message. There is nothing. The browser reports it received no data. So it is as if for some reason, the Apache process itself dies.

My thinking is that something is exceeding php configuration settings. But what could it be? I already solved issue with public pages, thanks to U.Tews, who instructed to change setting pcre.backtrack_limit to -1, because on public pages, the script was dying when running a preg_match call on a very long regular expression. I thought that might solve all issues but no, the issue on these admin pages persists.

Could it be too many variables created or something? I tried get_included_files() before the require_once that fails, and it tells me there are 87 included files.

This is very puzzling. Thank you for any help.
Back to top
View user's profile Send private message
U.Tews
Administrator


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

PostPosted: Thu Nov 07, 2013 8:19 pm    Post subject: Reply with quote

Does your script define constant SMARTY_CORE_DIR?
Normally it should not be necessary to define it. But if defined it must point to the libs/internals/ folder of the Smarty distribution.
Back to top
View user's profile Send private message
dmitryg
Smarty Rookie


Joined: 06 Nov 2013
Posts: 5

PostPosted: Thu Nov 07, 2013 8:29 pm    Post subject: Reply with quote

Hi U.Tews, thanks for replying.

Yes the constant is defined and points to internals folder.

There is home.tpl, which includes at some point main.tpl, which at some point includes display_tools.tpl and all of them have this same require_once line. It works on the first two, it causes Apache crash on display_tools.

-Dmitry

U.Tews wrote:
Does your script define constant SMARTY_CORE_DIR?
Normally it should not be necessary to define it. But if defined it must point to the libs/internals/ folder of the Smarty distribution.
Back to top
View user's profile Send private message
U.Tews
Administrator


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

PostPosted: Thu Nov 07, 2013 8:37 pm    Post subject: Reply with quote

What happens if you remove the definition of SMARTY_CORE_DIR?

Could be perhaps also too low PHP memory_limit....
Back to top
View user's profile Send private message
dmitryg
Smarty Rookie


Joined: 06 Nov 2013
Posts: 5

PostPosted: Thu Nov 07, 2013 8:46 pm    Post subject: Reply with quote

I already added ini_set('memory_limit','64M') and nothing changed.

I just fixed it. I restarted server, since behavior was so weird. And after restarting, it worked ok.

Thank you.

U.Tews wrote:
What happens if you remove the definition of SMARTY_CORE_DIR?

Could be perhaps also too low PHP memory_limit....
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