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

Error finding compiled template, but temp files written

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


Joined: 02 Feb 2004
Posts: 4

PostPosted: Mon Feb 02, 2004 8:29 pm    Post subject: Error finding compiled template, but temp files written Reply with quote

Hi, I have problem when running the example that comes with smarty's installation. The warnings sown are those :


Warning: fetch(c:/smarty/demo/templates_c\%%117\%%1172603085\index.tpl.php): failed to open stream: No such file or directory in C:\Smarty\libs\Smarty.class.php on line 1279

Warning: fetch(): Failed opening 'c:/smarty/demo/templates_c\%%117\%%1172603085\index.tpl.php' for inclusion (include_path='.;\xampp\php\pear\') in C:\Smarty\libs\Smarty.class.php on line 1279

...and a few more.

First i thought it was a permission problem, but into templates_c there are subfolders with what seem to be temp files, so smarty was able to write files in this directory.

Then I tried to debug the execution, and surprisingly, this time all was OK (debuggin with nusphere, with his own webserver). Index.tpl appeared in the working directory.

My 'server' (for learning purposes only) is running on W2K, and is a xampp pack (Apache/2.0.48 , php 4.2.4).

Any idea about what's happening ??

Thanks
Back to top
View user's profile Send private message
perez
Smarty n00b


Joined: 02 Feb 2004
Posts: 4

PostPosted: Tue Feb 03, 2004 7:28 am    Post subject: Reply with quote

Sorry, php version is 4.3.4
Back to top
View user's profile Send private message
messju
Administrator


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

PostPosted: Tue Feb 03, 2004 8:09 am    Post subject: Reply with quote

try with $smarty->use_sub_dirs=false .
Back to top
View user's profile Send private message Send e-mail Visit poster's website
perez
Smarty n00b


Joined: 02 Feb 2004
Posts: 4

PostPosted: Wed Feb 04, 2004 8:01 am    Post subject: Reply with quote

Tx. for the reply.

I tried using use_sub_dirs = false. This time no subfolders where generated., but the problem persists. Here are the error messages:

Warning: fetch(c:/smarty/demo/templates_c\%%117^%%1172603085^index.tpl.php): failed to open stream: No such file or directory in C:\Smarty\libs\Smarty.class.php on line 1279

Warning: fetch(): Failed opening 'c:/smarty/demo/templates_c\%%117^%%1172603085^index.tpl.php' for inclusion (include_path='.;\xampp\php\pear\') in C:\Smarty\libs\Smarty.class.php on line 1279

Warning: _include(c:/smarty/demo/templates_c\%%-46^%%-469713171^debug.tpl.php): failed to open stream: No such file or directory in C:\Smarty\libs\Smarty.class.php on line 1979

Warning: _include(): Failed opening 'c:/smarty/demo/templates_c\%%-46^%%-469713171^debug.tpl.php' for inclusion (include_path='.;\xampp\php\pear\') in C:\Smarty\libs\Smarty.class.php on line 1979

Temp files where generated, but not the mentioned in warnings.

I ran on the debugger and again it was successful (index.tpl.php generated). debugger's php version is 4.3.2
Back to top
View user's profile Send private message
kako
Smarty n00b


Joined: 05 Feb 2004
Posts: 3

PostPosted: Thu Feb 05, 2004 12:14 pm    Post subject: The same problem... and the solution Reply with quote

Hi,
I have installed smarty today, and i had the same problem... i tried with $smarty->use_sub_dirs=fals but the problem not fixed....
So i tried to specify absolut values... and i found the problem:

$compile_dir

The defautl value is not working for me, but if i set the value at top of script it works !!

$smarty = new Smarty;
$smarty->compile_dir = "./templates_c";

Can it be a bug?


Last edited by kako on Wed May 05, 2010 10:53 pm; edited 1 time in total
Back to top
View user's profile Send private message
messju
Administrator


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

PostPosted: Thu Feb 05, 2004 12:16 pm    Post subject: Reply with quote

no, it's not a bug.

if the default is not working for you, you have to change the value. that thing you do then is called "configuration".
Back to top
View user's profile Send private message Send e-mail Visit poster's website
kako
Smarty n00b


Joined: 05 Feb 2004
Posts: 3

PostPosted: Thu Feb 05, 2004 12:23 pm    Post subject: Reply with quote

Ok, thanks....

but, if default value of $compile_dir is "./templates_c" why i have to setup this value again? if i don't put the line:

$smarty->compile_dir = "./templates_c";

it doesn't work.

Sorry for my english... Razz

(It's only a note, i think smarty is fantastic and i want to use it ASAP) Smile


thx


Last edited by kako on Wed May 05, 2010 10:53 pm; edited 1 time in total
Back to top
View user's profile Send private message
messju
Administrator


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

PostPosted: Thu Feb 05, 2004 12:31 pm    Post subject: Reply with quote

@kako: it seems to me you don't have "." in your include_path. so you have to change "templates_c" to "./templates_c".
Back to top
View user's profile Send private message Send e-mail Visit poster's website
kako
Smarty n00b


Joined: 05 Feb 2004
Posts: 3

PostPosted: Thu Feb 05, 2004 12:37 pm    Post subject: Reply with quote

Perfect,
The "." was the error. Now i have put "." in include path and it works perfect.

thanls.


Last edited by kako on Wed May 05, 2010 10:53 pm; edited 1 time in total
Back to top
View user's profile Send private message
perez
Smarty n00b


Joined: 02 Feb 2004
Posts: 4

PostPosted: Thu Feb 05, 2004 6:53 pm    Post subject: Reply with quote

Unfortunately. i think it's not my problem. I defined an absolute path for compile_dir:

$smarty->compile_dir = 'c:/Smarty/demo/templates_c';

Another idea ??
Back to top
View user's profile Send private message
succhi
Smarty n00b


Joined: 19 Mar 2004
Posts: 2

PostPosted: Fri Mar 19, 2004 9:54 am    Post subject: include_path?? Reply with quote

@messju

Hi, are you talking about the "." in the include_path in php.ini?

If so I am not sure why I am getting the same errors as the original poster because I have include_path =".:/usr/local/php/include" already.

If I add $smarty->compile_dir = "./templates_c"; to each page then I have no problem but that means adding that to every page.

Any other ideas or is there another include_path out there that I'm missing?

Thanks
Back to top
View user's profile Send private message
succhi
Smarty n00b


Joined: 19 Mar 2004
Posts: 2

PostPosted: Fri Mar 19, 2004 10:16 am    Post subject: include_path?? Reply with quote

It's OK I think I've sorted it out now.
Back to top
View user's profile Send private message
bambam
Smarty n00b


Joined: 20 May 2004
Posts: 2

PostPosted: Thu May 20, 2004 1:29 pm    Post subject: Reply with quote

Hi perez, I have the same problem as you, I was able to solve the issue in the Demo that came with Smarty by adding ...

// If I do not have include_path set at all in PHP.ini, it works beautifully
// but I have set it for PEAR, so ...
$dev_include_dir = "c:/Apache2/htdocs/Smarty-2.6.2/libs/";
set_include_path(get_include_path() . ";" . $dev_include_dir);

$smarty->compile_dir = '../demo/templates_c';
// relative path from Smarty.class.php

The demo worked after that BUT ...

I tried this with a setup in another folder and still I get all the same old fetch() falied to open stream errors ... terrible ...

Have you found a solution? anybody else?
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