Smarty Forum Index Smarty
The discussions here are for Smarty, a template engine for the PHP programming language.

$use_sub_dirs

 
Post new topic   Reply to topic    Smarty Forum Index -> Smarty Development
View previous topic :: View next topic  
Author Message
Hinrich
Smarty Rookie


Joined: 18 Apr 2003
Posts: 33

PostPosted: Sun Apr 20, 2003 10:45 am    Post subject: $use_sub_dirs Reply with quote

Hi,

this feature helps as a workaround, but imho it is not a good solution. the problem is, that even if User and Group is defined in the /etc/httpd.conf, PHP seems to be running as eg. wwwrun.nogroup. The Apache settings only affects CGI scripts.

So what is it? A bug in Apache (or even a feature), a bug in PHP, a bug in Smarty or a bug in my brain?
Back to top
View user's profile Send private message
messju
Administrator


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

PostPosted: Sun Apr 20, 2003 11:45 am    Post subject: Re: $use_sub_dirs Reply with quote

Hinrich wrote:
So what is it? A bug in Apache (or even a feature), a bug in PHP, a bug in Smarty or a bug in my brain?


first of all AFAIK it is a design-issue in apache-1.3 and how modules are loaded and called there (but i'm not an expert on this).

since php3 the way the php-module is hooked in apache-1.3 prohibits the use of suexec-support, which is needed to honor apache's User- and Group-configuration-options. but even knowing this limitation people still insisted on using the php-module instead of the cgi-version to get in favour of the apache-features the module has and the slight performance gain the module implies.

in shared invironment the module-version is simply bad, since every user who can execute php does this with the same settings as all other php-users. providers still insisted on using the module-version instead of the cgi-version because "shared-environment==heavy-use==performance-needed".

so the php-guys invented safe_mode as an ugly workaround. the second sentence on http://www.php.net/manual/en/features.safe-mode.php
is: "It is architecturally incorrect to try to solve this problem at the PHP level, but since the alternatives at the web server and OS levels aren't very realistic, many people, especially ISP's, use safe mode for now."
so they (=php-team) admits it is only a workaround.

IMHO $use_sub_dirs is a feature to make smarty work in a restricted environment (aka "safe_mode").

greetings
messju
Back to top
View user's profile Send private message Send e-mail Visit poster's website
mohrt
Administrator


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

PostPosted: Sun Apr 20, 2003 7:11 pm    Post subject: Reply with quote

another way around $use_sub_dirs = false is if the php.ini setting "safe_mode_gid" is On. If that is the case, you can set-ID the group on the templates_c and cache folders. Then every file/directory created will retain the parent folder group id, and safe mode will allow it because the group id is valid.

Code:

chgrp nobody templates_c cache
chmod g+s template_c cache


where "nobody" is the group that files get written as.

Monte
Back to top
View user's profile Send private message Visit poster's website
Hinrich
Smarty Rookie


Joined: 18 Apr 2003
Posts: 33

PostPosted: Tue Apr 22, 2003 11:28 am    Post subject: Reply with quote

Thank you both for your help.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Smarty Forum Index -> Smarty Development 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