[PHPTAL] php in a shared host enviroment

al aldoogy at gmail.com
Sun Feb 18 00:37:35 CET 2007


I set up phptal on one user account on a shared host the other day and 
everything worked fine - I then copied the project onto another account 
on the same server. However the second instance failed with the message :

file_put_contents(/tmp/tpl_1_1_852ab91aa55bcd3f99ecc0789caf07d33.php): 
failed to open stream: Permission denied

at line 467 of PHPTAL.php

So it appears that the 1st account had already generated the 
'tpl_1_1_852ab91aa55bcd3f99ecc0789caf07d33.php' file with it's own 
permissions  - and so the second account could not open the file.

as a quick fix I changed the version to ,
define('PHPTAL_VERSION', '1_1_8_b');

( I tried quick fiixes like
define('FORCE_REPARSE', true);
or creating a local folder called tmp and then doing
define('PHPTAL_PHP_CODE_DESTINATION', 'tmp/');
but neither of those worked. ( It just said it couldn't find - 
tmp/tpl_1_1_852ab91aa55bcd3f99ecc0789caf07d33.php).


So anyway my question is,  how best can PHPTAL be made more robust for 
use in this kind of basic shared host situation  ?
Is this the problem  ?
line 390 of PHPTAL.php
$this->_functionName = 
'tpl_'.PHPTAL_VERSION.md5($this->_source->getRealPath());










More information about the PHPTAL mailing list