xampp and smarty - the further adventures

Problems with the Windows version of XAMPP, questions, comments, and anything related.

xampp and smarty - the further adventures

Postby Hamish » 30. June 2011 00:41

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'
Hamish
 
Posts: 15
Joined: 18. June 2011 21:21
Operating System: Windows 7

Re: xampp and smarty - the further adventures

Postby Hamish » 30. June 2011 00:48

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'
Hamish
 
Posts: 15
Joined: 18. June 2011 21:21
Operating System: Windows 7

Re: xampp and smarty - the further adventures

Postby Sharley » 30. June 2011 02:30

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
User avatar
Sharley
AF Moderator
 
Posts: 3316
Joined: 03. October 2008 05:10
Location: Yeppoon, Australia Time Zone: GMT/UTC+10
Operating System: Win 7 Pro 32bit/XP Pro SP3


Return to XAMPP for Windows

Who is online

Users browsing this forum: No registered users and 42 guests