Page 1 of 1

xampp and smarty - the further adventures

PostPosted: 30. June 2011 00:41
by Hamish
Ok - here it is:

I have downloaded Smarty 3.0.6 (as I read quite a lot of uncomplementary comments about 3.0.7) and have got it up and running - almost!

My file config (using windows 7) is:

../libs/Smarty-3.0.6/
and then -
cache/
configs/
templates/
templates_c/
demo/
libs/

I know that Smarty is set up properly and works because the demo runs. I have also run the 'install' file and that works but herein lies the problem: when I run the install.php the rresult I get is:

Smarty Installation test...
Testing template directory...
FAILED: .\templates\ is not a directory.
Testing compile directory...
FAILED: .\templates_c\ is not a directory.
Testing plugins directory...
..\libs\Smarty-3.0.6\libs\plugins\ is OK.
Testing cache directory...
FAILED: .\cache\ is not a directory.
Testing configs directory...
FAILED: .\configs\ is not a directory.
Tests complete.

I have run the following script - as recommended by the Smarty website but this hs no effect.

<?php

require_once('../libs/Smarty.class.php');
$smarty = new Smarty();

$smarty->setTemplateDir('/libs/Smarty-3.0.6/templates/');
$smarty->setCompileDir('/libs/Smarty-3.0.6/templates_c/');
$smarty->setCacheDir('/libs/Smarty-3.0.6/cache/');
$smarty->setConfigsDir('/libs/Smarty-3.0.6/configs/');

$smarty->testInstall();
//$smarty->utilities->test();

$smarty->assign('name', 'Ned');
$smarty->display('test.tpl');

?>

Any ideas about where I go from here would be gratefully received.

'H'

Re: xampp and smarty - the further adventures

PostPosted: 30. June 2011 00:48
by Hamish
Just a quite edit - the line in the script:

$smarty->setCompileDir('/libs/Smarty-3.0.6/templates_c/');

should, and does, read:

$smarty->setTemplates_cDir('/libs/Smarty-3.0.6/templates_c/');

Also 'configs' is correctly spelt in the code.

'H'

Re: xampp and smarty - the further adventures

PostPosted: 30. June 2011 02:30
by Sharley
Hamish wrote:...the line in the script:

$smarty->setCompileDir('/libs/Smarty-3.0.6/templates_c/');

should, and does, read:

$smarty->setTemplates_cDir('/libs/Smarty-3.0.6/templates_c/');
Once again your issue is with the paths.
As pointed out in my last post on this subject, the path you have in the quote above will be interpreted by Apache as looking for the above folders and files in the C:\xampp\htdocs\libs\Smarty-3.0.6templates_c\ folder structure and if they are not in that location then they will not be found.

Consider using an Alias in the C:\xampp\apache\conf\extra\httpd_xampp.conf file to tell the server where these Smarty folders are located especially if they are located outside of the htdocs folder - there are several examples like the webalizer entry for you to see how the Alias Directive works.

The Apache docs for Alias are here:
http://httpd.apache.org/docs/2.2/mod/mo ... html#alias