View previous topic :: View next topic |
Author |
Message |
twopeak Smarty Rookie
Joined: 09 Jun 2003 Posts: 12
|
Posted: Mon Jun 09, 2003 8:48 pm Post subject: problem writing '/index.tpl. |
|
|
I used to have the same problem as many people: writing to a dir would cause an error...
I solved it with the solutions from this forum, but now I'm running into these errors:
Code: | Warning: Smarty error: problem writing '/index.tpl.' in /home/.sites/65/site131/web/php/smarty/smarty.class.php on line 999
Warning: unable to create file /index.tpl because Permission denied in /home/.sites/65/site131/web/php/smarty/smarty.class.php on line 1518
Warning: Failed opening '/index.tpl' for inclusion (include_path='') in /home/.sites/65/site131/web/php/smarty/smarty.class.php on line 1112
Warning: Smarty error: problem writing '/file%3A^home^.sites^65^site131^web^php^smarty^debug.tpl.' in /home/.sites/65/site131/web/php/smarty/ smarty.class.php on line 999
Warning: unable to create file /file%3A^home^.sites^65^site131^web^php^smarty^debug.tpl because Permission denied in /home/.sites/65/site131/web/php/ smarty/smarty.class.php on line 1518
Warning: Failed opening '/file%3A^home^.sites^65^site131^web^php^smarty^debug.tpl' for inclusion (include_path='') in /home/.sites/65/site131/web/php/ smarty/smarty.class.php on line 1212 |
does it matter I'm using php 4.0.6?
--edit--
oops, damn it... I didn't ment to put this post in bugs, I just pressed the 'new topic' from one of the search results...
sorry! (maybe a mod could put it where it belongs?) |
|
Back to top |
|
messju Administrator
Joined: 16 Apr 2003 Posts: 3336 Location: Oldenburg, Germany
|
Posted: Tue Jun 10, 2003 12:16 am Post subject: |
|
|
it seems, that smarty cannot find your templates_c-directory. it's safest to you use a full-path for "$smarty->compile_dir" , otherwise you have to configure it relative to what getcwd() returns, which is in almost always the directory of the php-script you call and not relative to what SMARTY_DIR is set to.
php-4.0.6 is no problem. it's the minimum required version, which means it's enough |
|
Back to top |
|
twopeak Smarty Rookie
Joined: 09 Jun 2003 Posts: 12
|
Posted: Wed Jun 11, 2003 1:45 pm Post subject: |
|
|
ummmmmmmm
okay...
I'm sorry, I didn't really understand what you wrote, I'm no superadvanced user, I've been told smarty is the best way to use templates and I'm trying to install it now...
I have read the beginning of the manual and a quickstart guide, but I have no idea what you mean by templates_c-directory
and what is the full path to the smarty->compile_dir?
is it the path to the directory that contains the smarty files?
thanx for the help! |
|
Back to top |
|
messju Administrator
Joined: 16 Apr 2003 Posts: 3336 Location: Oldenburg, Germany
|
Posted: Wed Jun 11, 2003 2:13 pm Post subject: |
|
|
twopeak wrote: | ummmmmmmm
okay...
I'm sorry, I didn't really understand what you wrote, I'm no superadvanced user, I've been told smarty is the best way to use templates and I'm trying to install it now...
|
okay, sorry.
Quote: |
I have read the beginning of the manual and a quickstart guide, but I have no idea what you mean by templates_c-directory
and what is the full path to the smarty->compile_dir?
is it the path to the directory that contains the smarty files?
|
"templates_c" is the directory where smarty stores the templates after compilation. smarty reads your .tpl-files from your templates-dir and converts them to .php-files which are stored in templates_c. you can configure smarty to tell it where you templates-directory and your templates_c-directory is located:
(you have something like "$smarty = new Smarty;" in your index.php right ?) after that line you can access smarty and configure it.
for example:
Code: |
$smarty->template_dir = '/home/.sites/65/site131/web/php/smarty/templates';
$smarty->compile_dir = '/home/.sites/65/site131/web/php/smarty/templates_c';
(and various other things)
|
be sure the webserver has write-permissions to "/home/.sites/65/site131/web/php/smarty/templates_c" . thats all.
greetings
messju |
|
Back to top |
|
twopeak Smarty Rookie
Joined: 09 Jun 2003 Posts: 12
|
Posted: Fri Jun 20, 2003 9:31 am Post subject: |
|
|
uhmm, I'm still trying...
first of all, I had a problem with upercase names (I had my ftp client lowercase all filenames automaticly) I re-uploaded the latest version of smarty, with uppercase filenames
it seems like it does work better, now I get this error
Quote: | Fatal error: Failed opening required 'Smarty_Compiler.class.php' (include_path='') in /home/.sites/65/site131/web/php/smarty/libs/Smarty.class.php on line 1711 |
The first lines of the smarty.class.php file I have configured like this
Code: | /**
* set SMARTY_DIR to absolute path to Smarty library files.
* if not defined, include_path will be used.
*/
define('DIR_SEP', DIRECTORY_SEPARATOR);
/**
* Sets SMARTY_DIR only if user application has not already defined it
*/
if (!defined('SMARTY_DIR')) {
define('SMARTY_DIR', dirname('/home/.sites/65/site131/web/php/smarty/libs') . DIR_SEP);
} |
Do I need to set DIR_SEP to a '/' or should it stay like it is?
I get the same error in both ways...[/quote] |
|
Back to top |
|
messju Administrator
Joined: 16 Apr 2003 Posts: 3336 Location: Oldenburg, Germany
|
Posted: Fri Jun 20, 2003 10:04 am Post subject: |
|
|
don't change the contents of Smarty.class.php!
in your php-file simply do
Code: |
require_once('/home/.sites/65/site131/web/php/smarty/libs/Smarty.class.php');
|
and use Smarty.class.php as it comes with 2.5.0.
after the require SMARTY_DIR is set correctly.
__FILE__ is a php-constant that holds the current filename, so SMARTY_DIR is set to the directory where Smarty.class.php is located in. that's just what you want and if that works, the compiler should be loadable also.
an alternative would be:
Code: |
define('SMARTY_DIR','/home/.sites/65/site131/web/php/smarty/libs/');
require_once(SMARTY_DIR . 'Smarty.class.php');
|
which way to use is a matter of taste.
again: you don't have to change a single line inside Smarty.class.php for normal use.
HTH
messju |
|
Back to top |
|
twopeak Smarty Rookie
Joined: 09 Jun 2003 Posts: 12
|
Posted: Sun Jun 22, 2003 12:46 pm Post subject: |
|
|
alllllright!!!!!!!!!!!
it works!
you made me terribly happy!!!
I just re-downloaded the whole thing, putted it online and it worked! (why did I ever started to try & edit the file!!
THANKS ALOT! |
|
Back to top |
|
|