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

safe mode problems

 
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
kleinerChemiker
Smarty Rookie


Joined: 12 Dec 2003
Posts: 28

PostPosted: Mon Dec 29, 2003 8:36 pm    Post subject: safe mode problems Reply with quote

i get this error

Code:

Warning: SAFE MODE Restriction in effect. The script whose uid is 893 is not allowed to access /usr/lib/php owned by uid 0 in /home/.sites/137/site197/web/php_klassen/smarty/core/core.get_include_path.php on line 34

Warning: SAFE MODE Restriction in effect. The script whose uid is 893 is not allowed to access /usr/lib/php owned by uid 0 in /home/.sites/137/site197/web/php_klassen/smarty/core/core.get_include_path.php on line 34

Warning: Smarty error: unable to read resource: "head.html" in /home/.sites/137/site197/web/php_klassen/smarty/Smarty.class.php on line 1144


this is my start-script

Code:

<?php
// Smarty Library Dateien laden
define( 'SMARTY_DIR', '/home/sites/www.***.net/web/php_klassen/smarty/');
require (SMARTY_DIR . 'Smarty.class.php');

// ein guter Platz um Applikations spezifische Libraries zu laden
// require('guestbook/guestbook.lib.php');

class thorwal extends Smarty {

   function thorwal() {


      // Konstruktor. Diese Werte werden für jede Instanz automatisch gesetzt

      $this->Smarty();

      $this->template_dir = '/home/sites/www.***.net/web/thorwal-test/templates/';
      $this->compile_dir = '/home/sites/www.***.net/web/thorwal-test/templates_c/';
      $this->config_dir = '/home/sites/www.***.net/web/thorwal-test/configs/';
      $this->use_sub_dirs = !ini_get('safe_mode');
   }

}

?>


1) why do i get different paths in this error message and and with phpinfo() ?
2) i disabled use_sub_dirs but i still have saf mode errors

tia

MIK
Back to top
View user's profile Send private message
messju
Administrator


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

PostPosted: Mon Dec 29, 2003 10:08 pm    Post subject: Reply with quote

smarty uses php's include_path to look for plugins when compiling. set your include_path to a set of "allowed" directories.

this can be done with ini_set() if you don't have access to httpd.conf and .htaccess
Back to top
View user's profile Send private message Send e-mail Visit poster's website
kleinerChemiker
Smarty Rookie


Joined: 12 Dec 2003
Posts: 28

PostPosted: Tue Dec 30, 2003 2:27 pm    Post subject: Reply with quote

i've access to .htaccess (at least i can protect dirs with .htaccess). but how do i change the include_path from php with .htaccess?

tia

MIK
Back to top
View user's profile Send private message
Duncan
Smarty Pro


Joined: 16 Dec 2003
Posts: 166

PostPosted: Tue Dec 30, 2003 2:46 pm    Post subject: Reply with quote

See here for detailed info on this: http://ca2.php.net/configuration.changes
Back to top
View user's profile Send private message
kleinerChemiker
Smarty Rookie


Joined: 12 Dec 2003
Posts: 28

PostPosted: Thu Jan 01, 2004 10:04 pm    Post subject: Reply with quote

ok, it seems that i can use this, but now i get an internal server error Sad

MIK
Back to top
View user's profile Send private message
Duncan
Smarty Pro


Joined: 16 Dec 2003
Posts: 166

PostPosted: Thu Jan 01, 2004 10:59 pm    Post subject: Reply with quote

kleinerChemiker wrote:
ok, it seems that i can use this, but now i get an internal server error Sad

Most likely you added wrong entries to the .htaccess file. You can easily check on this, by renaming or deleting the .htaccess file and see if you still get that internal server error message.
If not, then it's a problem with the entries in the .htaccess file and you should check on the syntax.
Back to top
View user's profile Send private message
messju
Administrator


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

PostPosted: Thu Jan 01, 2004 11:25 pm    Post subject: Reply with quote

you may get "Internal Server Error" because "Override Options" is not allowed in your .htaccess. the error_log of the webserver gives you more info about the problem.
Back to top
View user's profile Send private message Send e-mail Visit poster's website
kleinerChemiker
Smarty Rookie


Joined: 12 Dec 2003
Posts: 28

PostPosted: Fri Jan 02, 2004 10:09 am    Post subject: Reply with quote

thx.
but i have no access to the error log.
maybe i can change the include dir with php. irc there is a function to override some php settings also with php.

MIK
Back to top
View user's profile Send private message
messju
Administrator


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

PostPosted: Fri Jan 02, 2004 10:11 am    Post subject: Reply with quote

that's what i suggested already in my first reply: ini_set()
Back to top
View user's profile Send private message Send e-mail Visit poster's website
kleinerChemiker
Smarty Rookie


Joined: 12 Dec 2003
Posts: 28

PostPosted: Fri Jan 02, 2004 10:21 am    Post subject: Reply with quote

Embarassed Embarassed Embarassed

edit: thx, this problem is solved now Very Happy

but, there is stil an other problem. i have this code in my setup-skript:

Code:

<?php
// Smarty Library Dateien laden
define( 'SMARTY_DIR', '/home/sites/www.***.net/web/php_klassen/smarty/');
require (SMARTY_DIR . 'Smarty.class.php');

// ein guter Platz um Applikations spezifische Libraries zu laden
// require('guestbook/guestbook.lib.php');

class thorwal extends Smarty {

   function thorwal() {


      // Konstruktor. Diese Werte werden für jede Instanz automatisch gesetzt

      $this->Smarty();

      $this->template_dir = '/home/sites/www.***.net/web/thorwal-test/templates/';
      $this->compile_dir = '/home/sites/www.***.net/web/thorwal-test/templates_c/';
      $this->config_dir = '/home/sites/www.***.net/web/thorwal-test/configs/';
      $this->use_sub_dirs = !ini_get('safe_mode');
   echo '<!-- test -->';
   }

}

?>

i found this code in the cowiki. but it seems, that the konstruktor stops being executed befor $this->use_sub_dirs, because there is no comment in the errors and Use_sub_dirs isn't set to false. if i set it to false in the main script in each template-start, it function well.

tia

MIK
Back to top
View user's profile Send private message
prutwo
Smarty n00b


Joined: 19 Jan 2004
Posts: 1

PostPosted: Mon Jan 19, 2004 11:56 pm    Post subject: I'm having the same error Reply with quote

Hi all,

I'm having the same error, and read all the forum messages about use sub dirs. If it helps, i'm hosted on an ensim server.

I have:
var $use_sub_dirs = false;
in my main smarty class, but I'm still getting these errors:

Code:

Warning: Smarty error: problem creating directory "./templates_c//%%110/%%1106396952" in /home/virtual/site55/fst/var/www/html/main/backends/smarty2/libs/Smarty.class.php on line 1042

Warning: Smarty error: problem writing temporary file './templates_c//%%110/%%1106396952/400c69ac7a99c' in /home/virtual/site55/fst/var/www/html/main/backends/smarty2/libs/Smarty.class.php on line 1042

Warning: touch(): SAFE MODE Restriction in effect. The script whose uid is 722 is not allowed to access /home/virtual/site55/fst/var/www/html/main/templates_c/%%110 owned by uid 48 in /home/virtual/site55/fst/var/www/html/main/backends/smarty2/libs/Smarty.class.php on line 1575

Warning: fetch(): Unable to access ./templates_c//%%110/%%1106396952/header.tpl.php in /home/virtual/site55/fst/var/www/html/main/backends/smarty2/libs/Smarty.class.php on line 1158

Warning: fetch(./templates_c//%%110/%%1106396952/header.tpl.php): failed to open stream: No such file or directory in /home/virtual/site55/fst/var/www/html/main/backends/smarty2/libs/Smarty.class.php on line 1158

Warning: fetch(): Failed opening './templates_c//%%110/%%1106396952/header.tpl.php' for inclusion (include_path='.:/php/includes:/usr/share/php') in /home/virtual/site55/fst/var/www/html/main/backends/smarty2/libs/Smarty.class.php on line 1158


Any suggestions ?

OP
Back to top
View user's profile Send private message
messju
Administrator


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

PostPosted: Tue Jan 20, 2004 11:43 am    Post subject: Re: I'm having the same error Reply with quote

prutwo wrote:
Any suggestions ?


you did something wrong in your setup. the error-messages indicate use_sub_dirs is on in your setup.
Back to top
View user's profile Send private message Send e-mail Visit poster's website
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