[PHPTAL] problem with changing tmp dir for compiled templates

Levi Stanley levi at eneservices.com
Mon May 14 16:20:26 CEST 2007


Is there any error messages in your webserver log files?

And does apache have the ability to write to that phptal directory you
created (/usr/local/www/www4.stat.pl/!lab/php-tal)?

Mynthon wrote:
> Hi!
>
> I would like to change tmp dir for templates.
>
> path to my phptal dir is:
> /usr/local/www/www4.stat.pl/!lab/php-tal/
>
> so in my index.php
> (/usr/local/www/www4.stat.pl/!lab/php-tal/tmp/index.php) im using
> something like this:
>
>
> <?php
> define('PHPTAL_PHP_CODE_DESTINATION',
> '/usr/local/www/www4.stat.pl/!lab/php-tal/tmp/');
> require_once 'PHPTAL.php';
> ..
> ..
> $template = new PHPTAL('tmpl.html');
> echo $template->execute();
> ?>
>
> and i get only blank page. When i remove define everything works ok.
> /tmp/ dir exists and it is writable. I debug it with this code in
> PHPTAL.php:
>
> //{{{PHPTAL_PHP_CODE_DESTINATION
> if (!defined('PHPTAL_PHP_CODE_DESTINATION')){
>    if (PHPTAL_OS_WIN){
>        if (file_exists('c:\\WINNT\\Temp\\')){
>            define('PHPTAL_PHP_CODE_DESTINATION', 'c:\\WINNT\\Temp\\');
>        }
>        else {
>            define('PHPTAL_PHP_CODE_DESTINATION', 'c:\\WINDOWS\\Temp\\');
>        }
>    }
>    else {
>        define('PHPTAL_PHP_CODE_DESTINATION', '/tmp/');
>    }
> }
> //____ LOOK HERE __ DIR EXISTS AND I CAN CREATE/WRITE FILES
> $fl = 'tmp'.time().'.txt';
> $f = fopen(PHPTAL_PHP_CODE_DESTINATION.$fl, "w");
> fwrite($f, 'a'.time());
> fclose($f);
> include(PHPTAL_PHP_CODE_DESTINATION.$fl);
> //}}}
>
>
> Any ideas?
>




More information about the PHPTAL mailing list