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

(PHP Accelerator + Smarty) = problems ?
Goto page 1, 2  Next
 
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 -> Installation and Setup
View previous topic :: View next topic  
Author Message
Hpatoio
Smarty Rookie


Joined: 29 Apr 2003
Posts: 25
Location: Italy

PostPosted: Thu May 08, 2003 11:14 am    Post subject: (PHP Accelerator + Smarty) = problems ? Reply with quote

Ciao !

I have installed PHP accelerator on a website
where I use Smarty, and nothing works anymore ! Shocked

This sounds strange, also because on PHP accelerator
website it stand that can be used with Smarty ! Shocked Shocked

Scenario :

I get templates from 2 different resources :

1) Some in the "normal" way i.e. from .tpl files in a "templates" directory
and with these everything is fine.

2) Others from DB and is with these that I have problems.


The function return me the right template ( I check this with a echo message in the function "db_get_template") but the template displayed is a random one !!!!

Shocked Shocked Shocked

Think that if I'm on a page and I just press "refresh" in my browser different templates (randomly) are shown each time !!!

I guess is a matter of cache ... because if I write :

Code:

$smarty->clear_all_cache();
$smarty->clear_compiled_tpl();


Everything works ...

Idea Ideas ???
Back to top
View user's profile Send private message Visit poster's website
AZTEK
Smarty Pro


Joined: 16 Apr 2003
Posts: 235
Location: Purdue University

PostPosted: Thu May 08, 2003 11:34 am    Post subject: Reply with quote

Which accelerator are you using?
_________________
"Imagine a school with children that can read and write, but with teachers who cannot, and you have a metaphor of the Information Age in which we live." -Peter Cochrane
Back to top
View user's profile Send private message Visit poster's website
Hpatoio
Smarty Rookie


Joined: 29 Apr 2003
Posts: 25
Location: Italy

PostPosted: Thu May 08, 2003 12:41 pm    Post subject: Reply with quote

I'm using PHP accelerator from ionCube

http://www.phpaccelerator.co.uk/

Smarty version is the 2.4

Simone
Back to top
View user's profile Send private message Visit poster's website
mohrt
Administrator


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

PostPosted: Thu May 08, 2003 6:55 pm    Post subject: Reply with quote

I use PHPA with Smarty and have zero problems with it. To be absolutely safe, flush your PHPA files and restart Apache any time you upgrade Smarty.

Monte
Back to top
View user's profile Send private message Visit poster's website
boots
Administrator


Joined: 16 Apr 2003
Posts: 5611
Location: Toronto, Canada

PostPosted: Thu May 08, 2003 7:09 pm    Post subject: Reply with quote

Can you give more information on your setup and how you are using it?

Which database and importantly, which database mechanism are you using? Persistant connections or no?

Is this a live system with multiple users accessing it? Are you using Smarty's caching? What happens when you force rebuilds on every page hit?

I find that software like PHPA are very good at exposing bugs in your code (or underlying layers).
Back to top
View user's profile Send private message
Hpatoio
Smarty Rookie


Joined: 29 Apr 2003
Posts: 25
Location: Italy

PostPosted: Wed May 14, 2003 7:56 am    Post subject: Reply with quote

Sorry if my answer come so late ... but I was ill.

Anyway ... now everything works fine (at least for the moment)
the "solution" was quite easy, i flushed all the "templates_c" and the "cache" directory, they were containing files created before the installation of PHP Accelerator, and then probably because of this Smarty had problems to find the right template to display.

If anythig'll happen I'll tell you ...

Bye
Simone
Back to top
View user's profile Send private message Visit poster's website
bjn
Smarty n00b


Joined: 17 Jun 2003
Posts: 3

PostPosted: Tue Jun 17, 2003 8:50 am    Post subject: Same problem Reply with quote

I have the same problem with random templates being displayed.
I'm also using PHP-A but Smarty 2.5.0 with PHP4.3.1...

I've only one template dir but with a lot of subdirs in it, and only one templates_c dir. I've set force_compile = 'true' now when I'm developing it. I'm not using any {include} although I have some <iframe> tags in the page.

I've tried using full absolute path, relative paths but it won't work.
Some filenames are very similar for example
catalogs.php
catalogs.artiklar.php
catalogs.article.php
catalogs.dbaction.php
and
catalogs.tpl.html
catalogs.artiklar.tpl.html
catalogs.article.tpl.html

(yes I know, I've mixed swedish with english Wink )

This shouldn't be any problems?
If I run clear_compiled_tpl() it works... for a while...

Anyone got any ideas?
Back to top
View user's profile Send private message
mohrt
Administrator


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

PostPosted: Tue Jun 17, 2003 2:22 pm    Post subject: Reply with quote

You might be dealing with a cache issue in PHPA, be sure it is set to always test for source file changes.
Back to top
View user's profile Send private message Visit poster's website
bjn
Smarty n00b


Joined: 17 Jun 2003
Posts: 3

PostPosted: Tue Jun 17, 2003 5:47 pm    Post subject: Reply with quote

I can't find how to set it to check for changes, although I tested to disable phpa completely and it worked so I guess there is a problem with phpa and its configuration.

Thank you
Back to top
View user's profile Send private message
mohrt
Administrator


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

PostPosted: Tue Jun 17, 2003 6:24 pm    Post subject: Reply with quote

Here's a good place to start:

http://www.php-accelerator.co.uk/releases/1.3.3/CONFIGURATION

According to the docs, PHPA files will always get regenerated upon a file change.

You don't happen to be dealing with clustered hosts or NFS mounted/cached filesystems are you?

Monte
Back to top
View user's profile Send private message Visit poster's website
bjn
Smarty n00b


Joined: 17 Jun 2003
Posts: 3

PostPosted: Tue Jun 17, 2003 8:01 pm    Post subject: Reply with quote

No, nothing special at all...
And I'm using PHPA with default settings...
Back to top
View user's profile Send private message
snlr
Smarty Rookie


Joined: 09 Jul 2003
Posts: 8
Location: Berlin

PostPosted: Wed Jul 09, 2003 5:13 pm    Post subject: Same here Reply with quote

I've got the same problem. {include file=""}'s are chosen randomly, or displayed twice, or displayed in neverending loops, or not displayed at all ... it's just like a slot machine, and it's impossible to win. :)

My server is using PHPA (Apache, PHP 4.3), only that I can't do anything about the settings. All Smarty gimmicks like cache, compile, subdirs, flushing dirs and so on was tried by me. Combined them in all possible ways.

Nothing.

I'll switch back to Frontpage now.
Back to top
View user's profile Send private message Visit poster's website
boots
Administrator


Joined: 16 Apr 2003
Posts: 5611
Location: Toronto, Canada

PostPosted: Wed Jul 09, 2003 5:24 pm    Post subject: Re: Same here Reply with quote

snlr wrote:
I'll switch back to Frontpage now.


Okay, that is FUNNY! I didn't even realize that it was available on Unix.

Seriously, does your code work with the accelarator turned off? Did you consider trying a different accelarator? Turck MMCache seems to work well for me--at least when my code is correct Wink
Back to top
View user's profile Send private message
snlr
Smarty Rookie


Joined: 09 Jul 2003
Posts: 8
Location: Berlin

PostPosted: Wed Jul 09, 2003 5:31 pm    Post subject: Reply with quote

"accelarator turned off" -- I don't know how to do that, I'm not the admin at our server (at work). I wrote him an e-mail, but I'm afraid he won't answer within the next few hours. If you keep answering in light speed like you did, I'm sure we can solve the issue much before he would.

Next trick?

(I wouldn't even need an accelerator right now -- can one turn off a thing like that by writing in .htaccess or something? Sorry for that question. I never used Frontpage, though.)
Back to top
View user's profile Send private message Visit poster's website
boots
Administrator


Joined: 16 Apr 2003
Posts: 5611
Location: Toronto, Canada

PostPosted: Wed Jul 09, 2003 5:43 pm    Post subject: Reply with quote

As much as I would like to help, you will have to bear the couple of hours it takes to communicate with your admin.

Are you sure that there is a PHP accelerator in use on your site? This thread is concerned with such issues, after all Smile If not, perhaps you have a code issue in which case you ought to post at least a fragment of your affected code in the general forum.
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 -> Installation and Setup All times are GMT
Goto page 1, 2  Next
Page 1 of 2

 
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