Re: [SMARTY] Again : Smarty error: problem creating directory. did I found something ?

From: Date: Thu, 08 Jan 2004 13:44:01 +0000
Subject: Re: [SMARTY] Again : Smarty error: problem creating directory. did I found something ?
References: 1  Groups: php.smarty.general 
Request: Send a blank email to php-smarty-general+get-10785@lists.php.net to get a copy of this message
On Thu, Jan 08, 2004 at 02:25:59PM +0100, Christopher Rousseau wrote: > I did use today a sharing hosting company to host a small web site. > > As usual I'm using smarty for it. > > > > I encounter the now well know "Smarty error: problem creating directory > '/home' in /home/seafarii1/Smarty-2.6.0/libs/Smarty.class.php" > > After some test and look on the previous mail in this liste I did try > the $smarty->use_sub_dirs=false; option and it did work. > > > > But I was not happy, my site use cache with cache_id and I prefer to use > sub dir than put many files in the same directory > > > > I did look inside the "smarty_core_create_dir_structure" function and > found a possible problem: > > > > On line 19 we found this line: > > $_open_basedir_ini = ini_get('open_basedir'); > > > > It seams that the create_dir function remove all directory found in > open_basedir before trying to create the new structure. nope. below is a test : "$_use_open_basedir = !empty($_open_basedir_ini)" basedirs are only honored if the value is set at all. > On my hosting php server, this parameter is not set at all. So smarty > try to create the full directory where my compile file are stored > > And failed creating the first one: "/home" because I have not the right > to write inside the root directory (even if this /home directory already > exist???). the test for the trigger_error is: if ($_make_new_dir && !file_exists($_new_dir) && !@mkdir($_new_dir, $smarty->_dir_perms) && !is_dir($_new_dir)) { that means the error should only occur if 'file_exists("/home")' returns false and is_dir("/home") returns false. can you test if this is the case? greetings messju > I have modified the smarty_core_create_dir_structure to force the > $_open_basedir_ini variable to be my root directory (in my exemple : > /home/seafarii1/) and it work now, but it's ugly :-). > > > > I don't know if somebody did work on it already and how to solve > definitively this problem in the proper way. > > I'm at the disposition of Messju or anybody else who want to look upon > it to provide more information if needed :-) > > > > > Christopher Rousseau

« previous php.smarty.general (#10785) next »