Re: Speed of demo
| From: | Monte Ohrt | Date: | Mon, 29 Oct 2001 16:57:37 +0000 |
| Subject: | Re: Speed of demo | ||
| References: | 1 | Groups: | php.smarty.general |
| Request: | Send a blank email to php-smarty-general+get-1762@lists.php.net to get a copy of this message | ||
Peter Bowyer wrote:
>
> At 09:25 AM 10/29/01 -0600, you wrote:
> >On our development server, I get ~ 0.104 seconds with Smarty
> >out-of-the-box configuration (cache OFF, compile check ON), latest
> >snapshot version. This is a sun sparc server, 440mzh. 4 seconds sounds a
> >bit lengthy, even on a slower system.
>
> OK, tried again today with the default config and got the following figures:
> index.tpl (0.17052) (total) test.conf [setup] local (0.00011) header.tpl
> (0.06312) footer.tpl (0.00550)
> index.tpl (0.15685) (total) test.conf [setup] local (0.00011) header.tpl
> (0.08736) footer.tpl (0.00142)
> index.tpl (0.20363) (total) test.conf [setup] local (0.00011) header.tpl
> (0.15974) footer.tpl (0.00148)
>
> This is a host running slackware linux with no PHP modules other than the
> default ones installed. For the first run above I emptied templates_c and
> deleted it, recreated the directory and then tried - the other figures are
> reloads of the page.
>
> As an aside, does anyone else have problems deleting the templates_c
> directory? I am just learning Unix so I may be making a silly mistake, but
> I found I had to create
> <?php
> require("smarty/Smarty.class.php");
> $smarty = new Smarty;
> $smarty->clear_compiled_tpl();
> ?>
> and run it first before I could delete the directory via ssh, using the
> command: rm -r templates_c. I guess it's because the directories are
> created by PHP and are therefore owned by nobody, while I have a different
> owner name (even for directories created via ssh when I thought I'd be
> nobody as well).
yes, the directories are created by another user. Also, the default
mod for the directories is 700, so you can't see the contents either.
You could do a couple of things:
1) delete the files as super user (if you have access)
2) change the default file mod to ugo+w (security concern here!)
3) change the group ownership of template_c to your group, and set the
sticky
bit on this directory (chmod g+s), then whenever files are created in
that
directory, they should have group ownership by you, and you can
remove them.
problem is to do it right, you'll need su access to initially set the
ownership of
templates_c to nobody:mygroup
#3 is optimal, you need to do this (probably as root)
mkdir templates_c
chown nobody:mygroup templates_c
chmod 770 templates_c
chmod g+s templates_c
ls
drwxrws--- 2 nobody mygroup 1024 Oct 29 10:56 templates_c
Then user nobody can write to this directory, anyone in "mygroup" can
edit/remove the files, and no one else can see the files.
>
> Also, I can never see the contents of the directories in templates_c either
> via FTP or SSH - via SSH I get a "permission denied" error. Even if I
> download templates_c to my HD via FTP, there's no files in the directories.
>
> Can someone explain the above to me please?
> Many thanks,
> Peter.
>
> ---oOo---
> sendcard - *The* PHP e-card solution
> http://www.sendcard.f2s.com/
> ---oOo---
--
Monte Ohrt <monte@ispi.net>
http://www.ispi.net/