View previous topic :: View next topic |
Author |
Message |
perez Smarty n00b
Joined: 02 Feb 2004 Posts: 4
|
Posted: Mon Feb 02, 2004 8:29 pm Post subject: Error finding compiled template, but temp files written |
|
|
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 |
|
perez Smarty n00b
Joined: 02 Feb 2004 Posts: 4
|
Posted: Tue Feb 03, 2004 7:28 am Post subject: |
|
|
Sorry, php version is 4.3.4 |
|
Back to top |
|
messju Administrator
Joined: 16 Apr 2003 Posts: 3336 Location: Oldenburg, Germany
|
Posted: Tue Feb 03, 2004 8:09 am Post subject: |
|
|
try with $smarty->use_sub_dirs=false . |
|
Back to top |
|
perez Smarty n00b
Joined: 02 Feb 2004 Posts: 4
|
Posted: Wed Feb 04, 2004 8:01 am Post subject: |
|
|
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 |
|
kako Smarty n00b
Joined: 05 Feb 2004 Posts: 3
|
|
Back to top |
|
messju Administrator
Joined: 16 Apr 2003 Posts: 3336 Location: Oldenburg, Germany
|
Posted: Thu Feb 05, 2004 12:16 pm Post subject: |
|
|
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 |
|
kako Smarty n00b
Joined: 05 Feb 2004 Posts: 3
|
|
Back to top |
|
messju Administrator
Joined: 16 Apr 2003 Posts: 3336 Location: Oldenburg, Germany
|
Posted: Thu Feb 05, 2004 12:31 pm Post subject: |
|
|
@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 |
|
kako Smarty n00b
Joined: 05 Feb 2004 Posts: 3
|
|
Back to top |
|
perez Smarty n00b
Joined: 02 Feb 2004 Posts: 4
|
Posted: Thu Feb 05, 2004 6:53 pm Post subject: |
|
|
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 |
|
succhi Smarty n00b
Joined: 19 Mar 2004 Posts: 2
|
Posted: Fri Mar 19, 2004 9:54 am Post subject: include_path?? |
|
|
@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 |
|
succhi Smarty n00b
Joined: 19 Mar 2004 Posts: 2
|
Posted: Fri Mar 19, 2004 10:16 am Post subject: include_path?? |
|
|
It's OK I think I've sorted it out now. |
|
Back to top |
|
bambam Smarty n00b
Joined: 20 May 2004 Posts: 2
|
Posted: Thu May 20, 2004 1:29 pm Post subject: |
|
|
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 |
|
|