|
Smarty
WARNING: All discussion is moving to https://reddit.com/r/smarty, please go there! This forum will be closing soon. |
|
View previous topic :: View next topic |
Author |
Message |
Maarten Smarty n00b
Joined: 05 Nov 2004 Posts: 4
|
Posted: Fri Nov 05, 2004 9:22 am Post subject: {$smarty.server.SERVER_NAME} PHP4 vs PHP5 |
|
|
Hello,
PHP4:
Code: | {$smarty.server.SERVER_NAME} |
gives the right servername.
PHP5:
Code: | {$smarty.server.SERVER_NAME} |
gives me nothing.
I'm using an local virtual host.
Does anybody else have the same experience?
Maarten |
|
Back to top |
|
Maarten Smarty n00b
Joined: 05 Nov 2004 Posts: 4
|
Posted: Fri Nov 05, 2004 9:27 am Post subject: extra information |
|
|
Sorry I forgot something
Code: | $_SERVER['SERVER_NAME']; |
works well and give the right server name in both PHP4 AND PHP5
Maarten |
|
Back to top |
|
kills Smarty Elite
Joined: 28 May 2004 Posts: 493
|
Posted: Fri Nov 05, 2004 9:41 am Post subject: |
|
|
have you cleared all cached/compiled files when changing the PHP Versions? |
|
Back to top |
|
Maarten Smarty n00b
Joined: 05 Nov 2004 Posts: 4
|
Posted: Fri Nov 05, 2004 9:51 am Post subject: |
|
|
Yes I did. I just repeated it again but unfortunately no change.
Maarten |
|
Back to top |
|
messju Administrator
Joined: 16 Apr 2003 Posts: 3336 Location: Oldenburg, Germany
|
Posted: Fri Nov 05, 2004 10:24 am Post subject: |
|
|
look in the *compiled* template: does smarty translate {$smarty.server.SERVER_NAME} to "echo $_SERVER['SERVER_NAME'];" or to "echo $HTTP_SERVER_VARS['SERVER_NAME']" ?
if it's the latter, then your smarty is too old or you have $smarty->request_use_auto_globals set to false. |
|
Back to top |
|
Maarten Smarty n00b
Joined: 05 Nov 2004 Posts: 4
|
Posted: Fri Nov 05, 2004 10:57 am Post subject: Always paths that give me headaches |
|
|
Aaargh. Shame, shame.
Although I had installed the latest Smarty.
I had forgotten to remove an old include path from my php.ini for PHP5.
And PHP was getting that old version (2.6.0) first.
Very stupid.
I'm also sorry for posting in the bugs section.
Thanks messju. Looking in the compiled version gave me the answer.
Maarten |
|
Back to top |
|
|
|
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
|