|
Smarty
WARNING: All discussion is moving to https://reddit.com/r/smarty, please go there! This forum will be closing soon. |
|
View previous topic :: View next topic |
Author |
Message |
Tara Smarty n00b
Joined: 25 Aug 2003 Posts: 3
|
Posted: Mon Aug 25, 2003 4:47 am Post subject: Demo errors... |
|
|
I've tried to run the Smarty demo (demo/index.php) but I get these errors:
Parse error: parse error, unexpected T_STRING in 'libs/Smarty.class.php' on line 52
Fatal error: Cannot instantiate non-existent class: smarty in 'demo/index.php' on line 7
I'm running Smarty 2.5.0. |
|
Back to top |
|
messju Administrator
Joined: 16 Apr 2003 Posts: 3336 Location: Oldenburg, Germany
|
Posted: Mon Aug 25, 2003 6:31 am Post subject: |
|
|
it seems you modified Smarty.class.php. there is no need to do that. untar a fresh version of Smarty-2.5.0.tar.gz and try again. |
|
Back to top |
|
Tara Smarty n00b
Joined: 25 Aug 2003 Posts: 3
|
Posted: Mon Aug 25, 2003 5:26 pm Post subject: |
|
|
Ok. I un-tarred an untouched version of Smarty.class.php and uploaded it and now I get the following errors:
Warning: Smarty error: problem creating directory "templates_c/%%117/%%1172603085" in 'libs/Smarty.class.php' on line 1042
Warning: Smarty error: problem writing temporary file 'templates_c/%%117/%%1172603085/3f4a4b4d34c3d' in 'libs/Smarty.class.php' on line 1042
Warning: SAFE MODE Restriction in effect. The script whose uid is 22349 is not allowed to access 'demo/templates_c/%%117' owned by uid 48 in 'libs/Smarty.class.php' on line 1575
Warning: Failed opening 'templates_c/%%117/%%1172603085/index.tpl.php' for inclusion (include_path='.:/php/includes:/usr/share/php') in 'libs/Smarty.class.php' on line 1158
Warning: Smarty error: problem creating directory "templates_c/%%-92/%%-924964192" in 'libs/Smarty.class.php' on line 1042
Warning: Smarty error: problem writing temporary file 'templates_c/%%-92/%%-924964192/3f4a4b4d3d590' in 'libs/Smarty.class.php' on line 1042
Warning: SAFE MODE Restriction in effect. The script whose uid is 22349 is not allowed to access 'demo/templates_c/%%-92' owned by uid 48 in 'libs/Smarty.class.php' on line 1575
Warning: Failed opening 'templates_c/%%-92/%%-924964192/debug.tpl.php' for inclusion (include_path='.:/php/includes:/usr/share/php') in 'libs/Smarty.class.php' on line 1258
Here's the contents of demo/index.php:
[php:1:a43679ea47]<?php
define('SMARTY_DIR','*ABSOLUTE PATH*/libs/');
require_once(SMARTY_DIR.'Smarty.class.php');
$smarty = new Smarty;
$smarty->compile_check = true;
$smarty->debugging = true;
$smarty->assign("Name","Fred Irving Johnathan Bradley Peppergill");
$smarty->assign("FirstName",array("John","Mary","James","Henry"));
$smarty->assign("LastName",array("Doe","Smith","Johnson","Case"));
$smarty->assign("Class",array(array("A","B","C","D"), array("E", "F", "G", "H"),
array("I", "J", "K", "L"), array("M", "N", "O", "P")));
$smarty->assign("contacts", array(array("phone" => "1", "fax" => "2", "cell" => "3"),
array("phone" => "555-4444", "fax" => "555-3333", "cell" => "760-1234")));
$smarty->assign("option_values", array("NY","NE","KS","IA","OK","TX"));
$smarty->assign("option_output", array("New York","Nebraska","Kansas","Iowa","Oklahoma","Texas"));
$smarty->assign("option_selected", "NE");
$smarty->display('index.tpl');
?>[/php:1:a43679ea47] |
|
Back to top |
|
boots Administrator
Joined: 16 Apr 2003 Posts: 5611 Location: Toronto, Canada
|
Posted: Mon Aug 25, 2003 5:43 pm Post subject: |
|
|
If your PHP is configured for safe mode then:
$smarty->use_sub_dirs = false; |
|
Back to top |
|
Tara Smarty n00b
Joined: 25 Aug 2003 Posts: 3
|
Posted: Mon Aug 25, 2003 6:52 pm Post subject: |
|
|
I don't have access to the PHP configuration file so I don't know how it is configured. Where do I put $smarty->use_sub_dirs = false;?
[Edit:] Never mind. I figured it out. [/Edit] |
|
Back to top |
|
|
|
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
|
|