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.server.SERVER_NAME} PHP4 vs PHP5

 
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 -> Bugs
View previous topic :: View next topic  
Author Message
Maarten
Smarty n00b


Joined: 05 Nov 2004
Posts: 4

PostPosted: Fri Nov 05, 2004 9:22 am    Post subject: {$smarty.server.SERVER_NAME} PHP4 vs PHP5 Reply with quote

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
View user's profile Send private message
Maarten
Smarty n00b


Joined: 05 Nov 2004
Posts: 4

PostPosted: Fri Nov 05, 2004 9:27 am    Post subject: extra information Reply with quote

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
View user's profile Send private message
kills
Smarty Elite


Joined: 28 May 2004
Posts: 493

PostPosted: Fri Nov 05, 2004 9:41 am    Post subject: Reply with quote

have you cleared all cached/compiled files when changing the PHP Versions?
Back to top
View user's profile Send private message
Maarten
Smarty n00b


Joined: 05 Nov 2004
Posts: 4

PostPosted: Fri Nov 05, 2004 9:51 am    Post subject: Reply with quote

Yes I did. I just repeated it again but unfortunately no change.

Maarten
Back to top
View user's profile Send private message
messju
Administrator


Joined: 16 Apr 2003
Posts: 3336
Location: Oldenburg, Germany

PostPosted: Fri Nov 05, 2004 10:24 am    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail Visit poster's website
Maarten
Smarty n00b


Joined: 05 Nov 2004
Posts: 4

PostPosted: Fri Nov 05, 2004 10:57 am    Post subject: Always paths that give me headaches Reply with quote

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
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 -> Bugs 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