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

Problem with installation Smarty on Windows

 
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
stevedzi
Smarty n00b


Joined: 07 May 2003
Posts: 2
Location: Serbia

PostPosted: Fri May 09, 2003 2:09 pm    Post subject: Problem with installation Smarty on Windows Reply with quote

I have a problem with installation Smarty on Windows. I have installed Smarty on my local server on Linux, on my ISP's server, too, and I didn't have problems.
On windows, my browser shows next massage:
Quote:
Fatal error: Call to undefined function: () in C:\Progra~1\Apache~1\Apache\htdocs\my_web_site\smarty\Smarty.class.php on line 1599

I have organized my files as you can see:
Code:

<?php

    define ("ROOT", "C:\\Progra~1\\Apache~1\\Apache\\htdocs\\my_web_site");
    define ("SMARTY_DIR", ROOT."\\smarty\\");
    require(SMARTY_DIR."Smarty.class.php");
   
    $smarty = new Smarty;
    $smarty->use_sub_dirs = false;
   
    $smarty->template_dir = ROOT."\\templates\\";
    $smarty->compile_dir = ROOT."\\templates_c\\";
    $smarty->config_dir = ROOT."\\configs\\";
    $smarty->cache_dir = ROOT."\\cache\\";

?>

Help me, Please
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: Fri May 09, 2003 2:35 pm    Post subject: Reply with quote

Which PHP version are you using, also which version of Smarty?
_________________
"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
boots
Administrator


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

PostPosted: Fri May 09, 2003 2:39 pm    Post subject: Reply with quote

Don't use those ugly 8-character equivalent names--use the full path names.

You can even use them like this:

c:/my path/to my apache/blah/

(from PHP, that is)
Back to top
View user's profile Send private message
stevedzi
Smarty n00b


Joined: 07 May 2003
Posts: 2
Location: Serbia

PostPosted: Mon May 12, 2003 10:35 am    Post subject: Reply with quote

The version of PHP is 4.21, and Smarty 2.4.1
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: Mon May 12, 2003 10:57 am    Post subject: Reply with quote

First upgrade your Smarty and see if that fixes it
_________________
"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
boots
Administrator


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

PostPosted: Mon May 12, 2003 2:11 pm    Post subject: Reply with quote

As I said before, don't use the 8-character names (the ~ names).

If you are upgrading, you should also move to PHP 4.3.1.
Back to top
View user's profile Send private message
Escape Velocity
Smarty Rookie


Joined: 07 Aug 2003
Posts: 5

PostPosted: Thu Aug 07, 2003 4:45 pm    Post subject: Reply with quote

Yes, I'm getting the same problems on Windoze, but using the latest versions of both PHP and Smarty. The LAMP install works just fine.

I've done some debugging and discovered that the error, funnily enough, is because the $resource_func variable is empty. A print_r on $this->_plugins['resource'] comes up with an empty array.

Globals are on, safe mode is off, and I can't trace the problem - can anyone with more knowledge of the class help?

Cheers

ev
Back to top
View user's profile Send private message
boots
Administrator


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

PostPosted: Thu Aug 07, 2003 5:10 pm    Post subject: Reply with quote

You need to set the $smarty->plugins_dir (or it defaults to "plugins" under SMARTY_DIR)
Back to top
View user's profile Send private message
Escape Velocity
Smarty Rookie


Joined: 07 Aug 2003
Posts: 5

PostPosted: Thu Aug 07, 2003 6:47 pm    Post subject: Reply with quote

The default is fine, and changing it, just to check, doesn't solve the problem... very annoying!
Back to top
View user's profile Send private message
boots
Administrator


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

PostPosted: Thu Aug 07, 2003 7:13 pm    Post subject: Reply with quote

Hmmm. Sounds annoying. This post may be of use to you.

Out of curiousity, are you using 2.5.0 or the CVS? I can only attest to the 2.5.0 version as being workable as I'm having problems with the CVS on Windows Wink
Back to top
View user's profile Send private message
CirTap
Smarty Pro


Joined: 04 Jun 2003
Posts: 106

PostPosted: Thu Aug 07, 2003 9:08 pm    Post subject: Reply with quote

Hi,
I always run into this error if I have some {include file=$TplFile} with $TplFile is pointing to some wrong directory/filename -- or beeing empty.
The error line differs slightly (#1607 in v2.5).

It's actually the most useless error message, because when I traced the loaded files in compile_template(), Smarty was quite aware of "what" Template-file was missing, but it reports an "unknown function ()" in whatever file this is expected to exist Wink -- maybe the non-existing compiled template of "nothing".

Make absolutely sure that your {include} files are in the correct path, tripple-check the // slashes. Try replacing any $TplName with the "filename.tpl" instead -- and check your paths Wink

I repeatingly run into this as I use a lot of path and URL mapping, and I'm still trying to find out, if there's any relationship of this wonderful error with $TplFile starting with 'file:' or not.
In any case, this "empty function" is more likely to appear if I use a variable for the (wrong) file to be {included}ed and not with {include fiel="notthere.tpl"}. The latter properly reports then 'notthere.tpl' is missing.

Hope this helps,
CirTap
Back to top
View user's profile Send private message
messju
Administrator


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

PostPosted: Thu Aug 07, 2003 9:24 pm    Post subject: Reply with quote

FYI: the call to undefinded function ()-error is normally caused by the attempt to call an unknown resource or unknown plugin. maybe you use
"c:/foo/bar" as a path. then smarty tries to load the resource named "c" and wants to call it's timestamp() and source() function. the correct path would be "file:c:/foo/bar" to avoid this.

the cvs version prevents this annoyance by forcing resource-names to have at least two chars. Smile

[EDIT: just to clarify the "file:" before fullpaths has to be where resources are used. that is $smarty->display(), {include}, {include_php} etc. . the paths inside the smarty object (like $smarty->template_dir, $smarty->plugin_dir etc. are paths and not resources and must not have a "file:" preceded]
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Escape Velocity
Smarty Rookie


Joined: 07 Aug 2003
Posts: 5

PostPosted: Fri Aug 22, 2003 2:32 pm    Post subject: Reply with quote

Cool - thanks for the tips. We ended up putting the site live on a BSD box (http://www.nescot.ac.uk/) if you want to see the modem site - broadband coming soon! But it's very annoying as we *need* to put it onto a Windows machine!

I'll see what happens and post any solutions I find!
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
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