View previous topic :: View next topic |
Author |
Message |
Marco Smarty Rookie
Joined: 17 Feb 2004 Posts: 6 Location: The Netherlands, Amsterdam
|
Posted: Wed May 19, 2004 10:14 am Post subject: core.write_file.php errors |
|
|
Hello,
I am recieving several core.write_file.php errors (see below) with Smarty 2.6.1.
I can not reproduce the errors every time.
They just occur approximately one out of 25 times.
Does someone know how to fix this problem?
Thank You,
Marco Wayop
-rename(/Tplcompiled\40ab38ce732f2,/Tplcompiled\%%102^%%1026873613^indexbegin.tpl.php): Permission denied
-fetch(/Tplcompiled\%%102^%%1026873613^indexbegin.tpl.php): failed to open stream: No such file or directory
-chmod(): No such file or directory
-rename(/Tplcompiled\40ab38ce82d59,/Tplcompiled\%%-19^%%-196724502^beam.tpl.php): File exists
AND:
-unlink(/Tplcompiled\%%200^%%2004204059^Javascripts.tpl.php): Permission denied
-rename(/Tplcompiled\40ab38da00e52,/Tplcompiled\%%200^%%2004204059^Javascripts.tpl.php): File exists
-rename(/Tplcompiled\40ab38da0ca09,/Tplcompiled\%%-11^%%-1117214203^menu_left.tpl.php): File exists |
|
Back to top |
|
electr0n Smarty Rookie
Joined: 26 Mar 2004 Posts: 32 Location: Germany
|
Posted: Wed May 19, 2004 2:33 pm Post subject: |
|
|
Permission denied , check the perms in your $compile_dir. |
|
Back to top |
|
Marco Smarty Rookie
Joined: 17 Feb 2004 Posts: 6 Location: The Netherlands, Amsterdam
|
Posted: Mon May 24, 2004 9:10 am Post subject: |
|
|
Hello electrOn,
thanks for your reply.
The webserver is also running on my Localhost where I have ALL permissions, so I don't believe it is a folder permission problem.
The chmod error occures on linenumber 44 in core.write.
@chmod($params['filename'], $smarty->_file_perms);
This eror probably occures because I am running the webserver on a Windows machine, instead of a unix based machine.
I still don't know how to fix this error and the remaining errors.
I have a sense the 'file exists' error is caused by Smarty, because it does not generate unique names with use_sub_dirs = false |
|
Back to top |
|
electr0n Smarty Rookie
Joined: 26 Mar 2004 Posts: 32 Location: Germany
|
Posted: Mon May 24, 2004 2:42 pm Post subject: |
|
|
Smarty shoudl also work with Windows, hm what happens if you delete the line? |
|
Back to top |
|
boots Administrator
Joined: 16 Apr 2003 Posts: 5611 Location: Toronto, Canada
|
Posted: Wed May 26, 2004 9:19 am Post subject: |
|
|
My IIS skills are rusty, but it really sounds like a permission issue. Chances are that the impersonated IIS user and the user attempting to make those changes have different rights.
If you try those changes from a script running under the same IUSR account, do you get the same issues? |
|
Back to top |
|
Marco Smarty Rookie
Joined: 17 Feb 2004 Posts: 6 Location: The Netherlands, Amsterdam
|
Posted: Fri May 28, 2004 2:49 pm Post subject: |
|
|
I am using Apache (and not IIS) with php and my versions are up to date.
I discovered when Smarty generates the error below the compiled file really doesn't exists. When I refresh my browser it suddenly works.
So sometimes I get the error, but not always.......
I'm flabbergasted.....
Line: 1266 in \portal.reject.nl\Includes\Smarty\Smarty.class.php
Message: fetch(): Failed opening 'C:\smarty\tplcompiled\%%102^%%1026873613^indexbegin.tpl.php' for inclusion (include_path='.;c:\php4\pear') |
|
Back to top |
|
boots Administrator
Joined: 16 Apr 2003 Posts: 5611 Location: Toronto, Canada
|
Posted: Sat May 29, 2004 1:58 am Post subject: |
|
|
hmmm. I wonder if this is a race condition on a temporary file.
Can you give more details? eg: are you using absolute paths for your configs? open_base_dirs? include paths? etc...
I have never seen this issue and have several production sites that run various versions of apache (1.3.x) on various versions of windows (NT, 2000) using various versions of Smarty (2.2 to present--I've also used older versions without seeing this, but 2.2 is the oldest that I have which is still in production). |
|
Back to top |
|
Marco Smarty Rookie
Joined: 17 Feb 2004 Posts: 6 Location: The Netherlands, Amsterdam
|
Posted: Wed Jun 02, 2004 10:38 am Post subject: |
|
|
/*
The lines below are placed in Includes\conf.php wich is included_once in
index.php
The Templates directory is located in the website rootdir
and the Tplcompiled directory is located in the root of the c: partition
Also require_once("Smarty/Smarty.class.php") is in the conf.php file
The Smarty Folder is located in the Includes folder.
All my path and inlude settings in php.ini are standard
*/
$tpl = new Smarty;
$tpl->use_sub_dirs = false;
$tpl->force_compile = true;
$tpl->template_dir = 'Templates';
$tpl->compile_dir = '/Tplcompiled';
$tpl->compile_check = true;
$tpl->debugging = false;
$tpl->caching = false;
//Tanks for your reply!
//Marco |
|
Back to top |
|
boots Administrator
Joined: 16 Apr 2003 Posts: 5611 Location: Toronto, Canada
|
Posted: Wed Jun 02, 2004 10:46 am Post subject: |
|
|
hmm, not much to see there. One thing though: try using absolute paths when you set your smarty directories--I have had problems with relative paths (at least on windows). |
|
Back to top |
|
|