View previous topic :: View next topic |
Author |
Message |
Hpatoio Smarty Rookie
Joined: 29 Apr 2003 Posts: 25 Location: Italy
|
Posted: Thu May 08, 2003 11:14 am Post subject: (PHP Accelerator + Smarty) = problems ? |
|
|
Ciao !
I have installed PHP accelerator on a website
where I use Smarty, and nothing works anymore !
This sounds strange, also because on PHP accelerator
website it stand that can be used with Smarty !
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 !!!!
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 ...
Ideas ??? |
|
Back to top |
|
AZTEK Smarty Pro
Joined: 16 Apr 2003 Posts: 235 Location: Purdue University
|
Posted: Thu May 08, 2003 11:34 am Post subject: |
|
|
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 |
|
Hpatoio Smarty Rookie
Joined: 29 Apr 2003 Posts: 25 Location: Italy
|
|
Back to top |
|
mohrt Administrator
Joined: 16 Apr 2003 Posts: 7368 Location: Lincoln Nebraska, USA
|
Posted: Thu May 08, 2003 6:55 pm Post subject: |
|
|
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 |
|
boots Administrator
Joined: 16 Apr 2003 Posts: 5611 Location: Toronto, Canada
|
Posted: Thu May 08, 2003 7:09 pm Post subject: |
|
|
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 |
|
Hpatoio Smarty Rookie
Joined: 29 Apr 2003 Posts: 25 Location: Italy
|
Posted: Wed May 14, 2003 7:56 am Post subject: |
|
|
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 |
|
bjn Smarty n00b
Joined: 17 Jun 2003 Posts: 3
|
Posted: Tue Jun 17, 2003 8:50 am Post subject: Same problem |
|
|
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 )
This shouldn't be any problems?
If I run clear_compiled_tpl() it works... for a while...
Anyone got any ideas? |
|
Back to top |
|
mohrt Administrator
Joined: 16 Apr 2003 Posts: 7368 Location: Lincoln Nebraska, USA
|
Posted: Tue Jun 17, 2003 2:22 pm Post subject: |
|
|
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 |
|
bjn Smarty n00b
Joined: 17 Jun 2003 Posts: 3
|
Posted: Tue Jun 17, 2003 5:47 pm Post subject: |
|
|
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 |
|
mohrt Administrator
Joined: 16 Apr 2003 Posts: 7368 Location: Lincoln Nebraska, USA
|
Posted: Tue Jun 17, 2003 6:24 pm Post subject: |
|
|
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 |
|
bjn Smarty n00b
Joined: 17 Jun 2003 Posts: 3
|
Posted: Tue Jun 17, 2003 8:01 pm Post subject: |
|
|
No, nothing special at all...
And I'm using PHPA with default settings... |
|
Back to top |
|
snlr Smarty Rookie
Joined: 09 Jul 2003 Posts: 8 Location: Berlin
|
Posted: Wed Jul 09, 2003 5:13 pm Post subject: Same here |
|
|
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 |
|
boots Administrator
Joined: 16 Apr 2003 Posts: 5611 Location: Toronto, Canada
|
Posted: Wed Jul 09, 2003 5:24 pm Post subject: Re: Same here |
|
|
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 |
|
Back to top |
|
snlr Smarty Rookie
Joined: 09 Jul 2003 Posts: 8 Location: Berlin
|
Posted: Wed Jul 09, 2003 5:31 pm Post subject: |
|
|
"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 |
|
boots Administrator
Joined: 16 Apr 2003 Posts: 5611 Location: Toronto, Canada
|
Posted: Wed Jul 09, 2003 5:43 pm Post subject: |
|
|
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 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 |
|
|