Smarty Forum Index Smarty
The discussions here are for Smarty, a template engine for the PHP programming language.
Smarty Error: the $compile_dir '..' does not exist...
Goto page Previous  1, 2, 3  Next
 
Post new topic   Reply to topic    Smarty Forum Index -> Installation and Setup
View previous topic :: View next topic  
Author Message
speedieB
Smarty n00b


Joined: 03 Jul 2005
Posts: 2

PostPosted: Tue Jul 05, 2005 3:32 pm    Post subject: hallelujah !!!! Reply with quote

it was those darn file permissions! Laughing
now up and running!
thanks for your help
Back to top
View user's profile Send private message
boots
Administrator


Joined: 16 Apr 2003
Posts: 5613
Location: Toronto, Canada

PostPosted: Tue Jul 05, 2005 3:55 pm    Post subject: Re: hallelujah !!!! Reply with quote

speedieB wrote:
it was those darn file permissions!


It almost always is! Wink

Greetings.
Back to top
View user's profile Send private message
rrok
Smarty Rookie


Joined: 30 Sep 2005
Posts: 5
Location: Slovenia

PostPosted: Fri Sep 30, 2005 5:05 pm    Post subject: Reply with quote

Hi!
I read all about solving this problem but i just cant get my smarty to work Confused

I'm running it on Gentoo Linux, Apache 2.0.54 ana PHP 5.0.5.

My directory structure:
home
rok
Workstation
Smarty //Apache doesnt "know" for this dir Smile
WWW //Doc root for Apache

This is what ls-l returns:
Code:
rok@tux ~/Workstation/Smarty $ ls -l
total 183
-rw-rw-r--  1 rok users 12715 Sep 24 16:38 Config_File.class.php
-rw-rw-r--  1 rok users 62932 Sep 24 16:38 Smarty.class.php
-rw-rw-r--  1 rok users 91063 Sep 24 16:38 Smarty_Compiler.class.php
drwxrwxrwx  2 rok users    48 Sep 29 20:27 cache
drwxr-xr-x  2 rok users    48 Sep 29 20:10 configs
-rw-rw-r--  1 rok users  5066 Sep 24 16:38 debug.tpl
drwxr-xr-x  2 rok users  1040 Sep 24 16:41 internals
drwxr-xr-x  2 rok users  1952 Sep 24 16:41 plugins
drwxrwxrwx  2 rok users   176 Sep 29 20:09 templates
drwxrwxrwx  2 rok users    48 Sep 29 22:23 templates_c


I tried with chmod and chown but it doesnt work.
I have also used this code to test permissions:
Code:
         echo "attempting to write to $this->smarty->compile_dir\n";
         file_put_contents($this->smarty->compile_dir . 'foo.txt', 'test');
         $myfile = $this->smarty->template_dir . "/index.tpl";
         echo "attempting to read $myfile\n";
         readfile($myfile);

it returns
Code:
attempting to write to Object id #5->compile_dir
Warning: file_put_contents(templates_cfoo.txt) [function.file-put-contents]: failed to open stream: Permission denied in /home/rok/Workstation/WWW/projects/autoclips/lib/gallery.class.php on line 59


If i run this piece of code:
Code:
      $dirs = array(TEMPLATES_DIR, TEMPLATES_C_DIR, CACHE_DIR, CONFIGS_DIR);
      foreach($dirs as $dir)
      {
         if(is_writeable($dir))
            print "$dir......OK<br>";

      }

Code:

/home/rok/Workstation/Smarty/templates......OK
/home/rok/Workstation/Smarty/templates_c......OK
/home/rok/Workstation/Smarty/cache......OK
/home/rok/Workstation/Smarty/configs......OK


What should i do?[/list]
Back to top
View user's profile Send private message
mohrt
Administrator


Joined: 16 Apr 2003
Posts: 7286
Location: Lincoln Nebraska, USA

PostPosted: Fri Sep 30, 2005 7:28 pm    Post subject: Reply with quote

Try this test class:

http://www.phpinsider.com/smarty-forum/viewtopic.php?t=4500
Back to top
View user's profile Send private message Visit poster's website
rrok
Smarty Rookie


Joined: 30 Sep 2005
Posts: 5
Location: Slovenia

PostPosted: Fri Sep 30, 2005 7:42 pm    Post subject: Reply with quote

After recommendation on another forum i moved Smarty to /var/Smarty.

This is ls output:
Code:
sh-3.00# ls -l
total 195
-rwxrwxrwx  1 root root  12715 Sep 24 16:38 Config_File.class.php
-rwxrwxrwx  1 root root  62932 Sep 24 16:38 Smarty.class.php
-rwxrwxrwx  1 root root  91063 Sep 24 16:38 Smarty_Compiler.class.php
-rw-r--r--  1 root root   5318 Sep 30 21:33 Smarty_Test.class.php
-rw-r--r--  1 root root      2 Sep 30 21:32 Smarty_Test.class.php~
drwxrwxrwx  2 rok  users    48 Sep 30 21:18 cache
drwxr-xr-x  2 root root     48 Sep 30 21:18 configs
-rwxrwxrwx  1 root root   5066 Sep 24 16:38 debug.tpl
drwxr-xr-x  2 root root   1040 Sep 30 21:18 internals
drwxrwxrwx  2 root root   1952 Sep 30 21:19 plugins
drwxr-xr-x  2 rok  users   176 Sep 30 21:18 templates
drwxrwxrwx  2 rok  users    48 Sep 30 21:18 templates_c


Test result:
Code:
testing start:
template_dir is 'templates'
real system path: /home/rok/Workstation/WWW/projects/autoclips/templates
file perms: 0777
OK.
config_dir is 'configs'
real system path:

Warning: fileperms() [function.fileperms]: stat failed for configs in /var/Smarty/Smarty_Test.class.php on line 26
file perms: 0
error: config_dir 'configs' does not exist.
plugins_dir (0) is 'plugins'
real system path:

Warning: fileperms() [function.fileperms]: stat failed for plugins in /var/Smarty/Smarty_Test.class.php on line 39
file perms: 0
error: plugins_dir 'plugins' does not exist.
compile_dir is 'templates_c'
real system path: /home/rok/Workstation/WWW/projects/autoclips/templates_c
file perms: 0777
OK.
cache_dir is 'cache'
real system path:

Warning: fileperms() [function.fileperms]: stat failed for cache in /var/Smarty/Smarty_Test.class.php on line 77
file perms: 0
error: cache_dir 'cache' does not exist.
testing complete.
Back to top
View user's profile Send private message
rrok
Smarty Rookie


Joined: 30 Sep 2005
Posts: 5
Location: Slovenia

PostPosted: Fri Sep 30, 2005 7:55 pm    Post subject: Reply with quote

OK it is working now just fine except cache dir Mad
Back to top
View user's profile Send private message
mohrt
Administrator


Joined: 16 Apr 2003
Posts: 7286
Location: Lincoln Nebraska, USA

PostPosted: Fri Sep 30, 2005 8:40 pm    Post subject: Reply with quote

use full system filepaths in your setup.

[php:1:58f2b1d8e2]$smarty->cache_dir = '/full/path/to/cache';[/php:1:58f2b1d8e2]
Back to top
View user's profile Send private message Visit poster's website
rrok
Smarty Rookie


Joined: 30 Sep 2005
Posts: 5
Location: Slovenia

PostPosted: Fri Sep 30, 2005 9:08 pm    Post subject: Reply with quote

I'm already using that Smile

I just dont understand
Here is my current ls output
Code:
sh-3.00# ls -l
total 195
-rwxrwxrwx  1 root root  12715 Sep 24 16:38 Config_File.class.php
-rwxrwxrwx  1 root root  62932 Sep 24 16:38 Smarty.class.php
-rwxrwxrwx  1 root root  91063 Sep 24 16:38 Smarty_Compiler.class.php
-rwxrwxrwx  1 root root   5318 Sep 30 21:33 Smarty_Test.class.php
-rwxrwxrwx  1 root root      2 Sep 30 21:32 Smarty_Test.class.php~
drwxrwxrwx  2 rok  users    96 Sep 30 21:58 cache
drwxrwxrwx  2 root root     48 Sep 30 21:18 configs
-rwxrwxrwx  1 root root   5066 Sep 24 16:38 debug.tpl
drwxrwxrwx  2 root root   1040 Sep 30 21:18 internals
drwxrwxrwx  2 rok  users  1952 Sep 30 21:19 plugins
drwxrwxrwx  2 rok  users   176 Sep 30 21:18 templates
drwxrwxrwx  2 rok  users   144 Sep 30 21:58 templates_c


Code:
   define("TEMPLATES_DIR", "/var/Smarty/templates");
   define("TEMPLATES_C_DIR", "/var/Smarty/templates_c");
   define("CACHE_DIR", "/var/Smarty/cache");
   define("CONFIGS_DIR", "/var/Smarty/configs");
   define("PLUGIN_DIR", "/var/Smarty/plugins");

         // Setting smarty
          $this->site->smarty->use_sub_dirs = false;
         $this->site->smarty->template_dir = TEMPLATES_DIR;
         $this->site->smarty->compile_dir  = TEMPLATES_C_DIR;
         $this->site->smarty->config_dir   = CONFIGS_DIR;
         $this->site->smarty->cache_dir    = CACHE_DIR;
         $this->site->smarty->plugins_dir  = PLUGIN_DIR;
           $this->smarty->caching = true;
              $this->smarty->debugging = true;


The same settings as other dirs but it doesnt work
Back to top
View user's profile Send private message
mohrt
Administrator


Joined: 16 Apr 2003
Posts: 7286
Location: Lincoln Nebraska, USA

PostPosted: Fri Sep 30, 2005 9:47 pm    Post subject: Reply with quote

What is the error? It still says it is unable to stat the cache dir?
Back to top
View user's profile Send private message Visit poster's website
rrok
Smarty Rookie


Joined: 30 Sep 2005
Posts: 5
Location: Slovenia

PostPosted: Sat Oct 01, 2005 3:10 pm    Post subject: Reply with quote

OMG it was my fault. I was setting my smarty config variables wrong.

$this->site->smarty->xxx
instead of
$this->smarty

Rolling Eyes Embarassed
Back to top
View user's profile Send private message
extra74
Smarty n00b


Joined: 20 Apr 2008
Posts: 3

PostPosted: Sun Apr 20, 2008 2:39 pm    Post subject: Reply with quote

It works fine for me .
_________________
www.svensk-server.info
Back to top
View user's profile Send private message Visit poster's website
gaunongthon
Smarty n00b


Joined: 04 Jun 2008
Posts: 1

PostPosted: Wed Jun 04, 2008 8:43 am    Post subject: Smarty on XAMPP 1.6.4 on Windows XP Reply with quote

I got this error
Fatal error: Smarty error: the $compile_dir 'templates_c' does not exist, or is not a directory. in E:\IDE\Smarty\libs\Smarty.class.php on line 1092

here is my code
Code:

<?php
require_once ('Smarty.class.php');
$smarty = new Smarty();

$smarty->template_dir = 'templates/';
$smarty->complie_dir = 'templates_c/';
$smarty->config_dir = 'configs/';
$smarty->cache_dir = 'cache/';

$smarty->assign ('name','Misan');
//$smary->debugging = true;

$smarty->display('index.tpl');

?>


I don't know how to fix this problem

Here is my php setting
safe_mode = on
safe_mode_grid = on

I am sure this is no problem with the path, I have modified the include_path to make it works properly.

Please advice on the permission to read/write file.

Thanks you vey much for reading and patient with me.
Back to top
View user's profile Send private message
mohrt
Administrator


Joined: 16 Apr 2003
Posts: 7286
Location: Lincoln Nebraska, USA

PostPosted: Wed Jun 04, 2008 1:35 pm    Post subject: Reply with quote

use absolute pathnames for the smarty directories. And, please post your problem only once.
Back to top
View user's profile Send private message Visit poster's website
sai
Smarty n00b


Joined: 06 Nov 2008
Posts: 1

PostPosted: Thu Nov 06, 2008 1:49 pm    Post subject: Helllo Sir Reply with quote

Can you clearly explain how to install Smarty step by step i am facing problem to install it also tell how to make example pages.
Back to top
View user's profile Send private message
foxit
Smarty n00b


Joined: 13 Aug 2010
Posts: 1

PostPosted: Fri Aug 13, 2010 9:01 am    Post subject: Instalation Reply with quote

This is what seems to be happening to me. I'm using windows with apache/php/mysql. I've had no real issues getting smarty going on linux and mac os x, however, we're pulling our hair out. It should be noted that we aren't windows people, but have opened up permissions on the directories.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Smarty Forum Index -> Installation and Setup All times are GMT
Goto page Previous  1, 2, 3  Next
Page 2 of 3

 
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