Re: AW: [SMARTY] SafeMode with Smarty 2.5.0
| From: | messju mohr | Date: | Sat, 19 Apr 2003 21:42:15 +0000 |
| Subject: | Re: AW: [SMARTY] SafeMode with Smarty 2.5.0 | ||
| References: | 1 2 | Groups: | php.smarty.general |
| Request: | Send a blank email to php-smarty-general+get-9343@lists.php.net to get a copy of this message | ||
On Sat, Apr 19, 2003 at 06:56:24PM +0200, alex =) wrote:
> Actually it is an interesting issue, since I, for example, can make dirs
> and create files with PHP scripts, BUT smarty with using sub dirs fails!
i cannot find the right reference at the moment but AFAIR safe_mode
affects the ownership of the directory the file you want to access
resides in.
if the script you run is owned by you and the directory is created and
thus owned by you, access to the files in it is granted (even if they
are owned by the webserver who created them).
but when the webserver creates the directory, in is owned by the
webserver and not by the user who owns the running script. this is
considered "unsafe" and so access is denied to files inside that
directory.
> =) btw, does not using subdirs affect performance in any way, especially
> in cached pages?
yes there should be a performance hit. certain filesystem tend to be
slower accessing directories with a lot of files in it, than accessing
files inside a deep directory-structure with only a few files per
directory. i never noticed a big difference nor tried to measure it, though.
greetings
messju
> alex
>
> Lars Jankowfsky wrote:
> >Hey Jason,
> >
> >set "usesubdirs" in smarty conf to false and it will work.
> >
> >Happy eastern :)
> >
> >lars
> >
> >-----Ursprüngliche Nachricht-----
> >Von: Jason Sheets [mailto:jason.sheets@hp.com]
> >Gesendet: Freitag, 18. April 2003 16:33
> >An: smarty-general@lists.php.net
> >Betreff: [SMARTY] SafeMode with Smarty 2.5.0
> >
> >
> >Hello Everyone,
> >
> >I'm having a problem using Smarty 2.5.0 with Safemode with PHP, I was
> >initially using 2.4.2 and upgraded to 2.5.0 in the hopes it might
> >resolve my problem.
> >A page containing phpinfo() can be accesse at
> >http://www.boisesbest.com/phpinfo.php
> >
> >I have configured smarty with the following:
> >
> >$smarty = new Smarty;
> >$smarty->plugins_dir = constant('BASE_INCLUDE_PATH') .
> >'/smarty/plugins';
> >$smarty->template_dir = constant('BASE_INCLUDE_PATH') .
> >'/templates/templates';
> >$smarty->compile_dir = constant('BASE_INCLUDE_PATH') .
> >'/templates/compile';
> >$smarty->config_dir = constant('BASE_INCLUDE_PATH') .
> >'/templates/config';
> >$smarty->cache_dir = constant('BASE_INCLUDE_PATH') .
> >'/templates/cache';
> >
> >The configuration works on my machine at home (Windows and Linux) with
> >safe mode disabled. When I upload it to the site that has PHP 4.3.1 It
> >fails to work, I receive the following messages:
> >
> >*Warning*: file_exists() [function.file-exists
> ><http://www.php.net/function.file-exists>]: SAFE MODE
> >Restriction in
> >effect. The script whose uid is 5252 is not allowed to access /soho
> >owned by uid 0 in
> >*/soho/boisesbest.com/ftproot/webroot/bb/include/smarty/libs/Smarty.class.ph
> >p*
> >on line *2251*
> >
> >*Warning*: Smarty error: problem creating directory
> >"/soho/boisesbest.com/ftproot/webroot/bb/include/templates/compile/%%117/%%1
> >172603085"
> >in
> >*/soho/boisesbest.com/ftproot/webroot/bb/include/smarty/libs/Smarty.class.ph
> >p*
> >on line *1042*
> >
> >*Warning*: Smarty error: problem writing temporary file
> >'/soho/boisesbest.com/ftproot/webroot/bb/include/templates/compile/%%117/%%1
> >172603085/3ea00a794a2a8'
> >in
> >*/soho/boisesbest.com/ftproot/webroot/bb/include/smarty/libs/Smarty.class.ph
> >p*
> >on line *1042*
> >
> >*Warning*: touch() [function.touch
> ><http://www.php.net/function.touch>]:
> >Unable to create file
> >/soho/boisesbest.com/ftproot/webroot/bb/include/templates/compile/%%117/%%11
> >72603085/index.tpl.php
> >because No such file or directory in
> >*/soho/boisesbest.com/ftproot/webroot/bb/include/smarty/libs/Smarty.class.ph
> >p*
> >on line *1575*
> >
> >*Warning*: fetch() [function.fetch
> ><http://www.php.net/function.fetch>]:
> >Unable to access
> >/soho/boisesbest.com/ftproot/webroot/bb/include/templates/compile/%%117/%%11
> >72603085/index.tpl.php
> >in
> >*/soho/boisesbest.com/ftproot/webroot/bb/include/smarty/libs/Smarty.class.ph
> >p*
> >on line *1158*
> >
> >*Warning*:
> >fetch(/soho/boisesbest.com/ftproot/webroot/bb/include/templates/compile/%%11
> >7/%%1172603085/index.tpl.php)
> >[function.fetch <http://www.php.net/function.fetch>]:
> >failed to create
> >stream: No such file or directory in
> >*/soho/boisesbest.com/ftproot/webroot/bb/include/smarty/libs/Smarty.class.ph
> >p*
> >on line *1158*
> >
> >*Warning*: fetch() [function.fetch
> ><http://www.php.net/function.fetch>]:
> >Failed opening
> >'/soho/boisesbest.com/ftproot/webroot/bb/include/templates/compile/%%117/%%1
> >172603085/index.tpl.php'
> >for inclusion (include_path='') in
> >*/soho/boisesbest.com/ftproot/webroot/bb/include/smarty/libs/Smarty.class.ph
> >p*
> >on line *1158
> >
> >*
> >I have chmodded the compile directory 777 but it fails to work.
> >
> >Any help is greatly appreciated.
> >
> >Jason
> >
> >
> >
> >
> >--
> >Smarty General Mailing List (http://smarty.php.net/)
> >To unsubscribe, visit: http://www.php.net/unsub.php
> >
> >
>
> --
> .::....::.:...::...:..:.:::..:..::..::.::..:.:.
>
> Kulikov Alexey - E-Com Development Consultant
>
> +43 699 1 9228792 | alex@inses.biz
>
>
> --
> Smarty General Mailing List (http://smarty.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php