View previous topic :: View next topic |
Author |
Message |
stevedzi Smarty n00b
Joined: 07 May 2003 Posts: 2 Location: Serbia
|
Posted: Fri May 09, 2003 2:09 pm Post subject: Problem with installation Smarty on Windows |
|
|
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 |
|
AZTEK Smarty Pro
Joined: 16 Apr 2003 Posts: 235 Location: Purdue University
|
Posted: Fri May 09, 2003 2:35 pm Post subject: |
|
|
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 |
|
boots Administrator
Joined: 16 Apr 2003 Posts: 5611 Location: Toronto, Canada
|
Posted: Fri May 09, 2003 2:39 pm Post subject: |
|
|
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 |
|
stevedzi Smarty n00b
Joined: 07 May 2003 Posts: 2 Location: Serbia
|
Posted: Mon May 12, 2003 10:35 am Post subject: |
|
|
The version of PHP is 4.21, and Smarty 2.4.1 |
|
Back to top |
|
AZTEK Smarty Pro
Joined: 16 Apr 2003 Posts: 235 Location: Purdue University
|
Posted: Mon May 12, 2003 10:57 am Post subject: |
|
|
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 |
|
boots Administrator
Joined: 16 Apr 2003 Posts: 5611 Location: Toronto, Canada
|
Posted: Mon May 12, 2003 2:11 pm Post subject: |
|
|
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 |
|
Escape Velocity Smarty Rookie
Joined: 07 Aug 2003 Posts: 5
|
Posted: Thu Aug 07, 2003 4:45 pm Post subject: |
|
|
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 |
|
boots Administrator
Joined: 16 Apr 2003 Posts: 5611 Location: Toronto, Canada
|
Posted: Thu Aug 07, 2003 5:10 pm Post subject: |
|
|
You need to set the $smarty->plugins_dir (or it defaults to "plugins" under SMARTY_DIR) |
|
Back to top |
|
Escape Velocity Smarty Rookie
Joined: 07 Aug 2003 Posts: 5
|
Posted: Thu Aug 07, 2003 6:47 pm Post subject: |
|
|
The default is fine, and changing it, just to check, doesn't solve the problem... very annoying! |
|
Back to top |
|
boots Administrator
Joined: 16 Apr 2003 Posts: 5611 Location: Toronto, Canada
|
Posted: Thu Aug 07, 2003 7:13 pm Post subject: |
|
|
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 |
|
Back to top |
|
CirTap Smarty Pro
Joined: 04 Jun 2003 Posts: 106
|
Posted: Thu Aug 07, 2003 9:08 pm Post subject: |
|
|
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 -- 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
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 |
|
messju Administrator
Joined: 16 Apr 2003 Posts: 3336 Location: Oldenburg, Germany
|
Posted: Thu Aug 07, 2003 9:24 pm Post subject: |
|
|
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.
[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 |
|
Escape Velocity Smarty Rookie
Joined: 07 Aug 2003 Posts: 5
|
Posted: Fri Aug 22, 2003 2:32 pm Post subject: |
|
|
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 |
|
|