By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
458,125 Members | 1,556 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 458,125 IT Pros & Developers. It's quick & easy.

Trouble Installing Smarty could really do with some help

P: n/a
M
Hi Folks,

I am trying to install Smarty using PHP 5 on a Windows XP PC using IIS
v6

The following PHP File:

<!doctype html public "-//W3C//DTD HTML 4.0 //EN">
<html>
<head>
<title>Title here!</title>
</head>
<body>
<?php
require('Smarty.class.php');
$smarty = new Smarty;

$smarty->template_dir = '/Program
Files/PhpIncludes/Smarty-2.6.9/demo/templates';
$smarty->compile_dir = '/Program
Files/PhpIncludes/Smarty-2.6.9/demo/templates_c';
$smarty->config_dir = '/Program
Files/PhpIncludes/Smarty-2.6.9/demo/configs/';
$smarty->cache_dir = '/Program Files/PhpIncludes/Smarty-2.6.9/demo/cache/';

$smarty->assign('name','Ned');

$smarty->display('index2.tpl');

?>
</body>
</html>
Gives the following error:

Warning: Smarty::fetch(/Program
Files/PhpIncludes/Smarty-2.6.9/demo/templates_c\%%93^934^9348F8B7%%index2.tpl.php)
[function.fetch]: failed to open stream: No such file or directory in
C:\Program Files\PhpIncludes\Smarty-2.6.9\libs\Smarty.class.php on line 1251

Warning: Smarty::fetch() [function.include]: Failed opening '/Program
Files/PhpIncludes/Smarty-2.6.9/demo/templates_c\%%93^934^9348F8B7%%index2.tpl.php'
for inclusion (include_path='.;C:\Program
Files\PhpIncludes\Smarty-2.6.9\libs') in C:\Program
Files\PhpIncludes\Smarty-2.6.9\libs\Smarty.class.php on line 1251
Any Ideas please?

Thanks,

Martin
Jul 17 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a
On Tue, 28 Jun 2005 18:54:48 GMT, "M" <ih*****************@spamgourmet.com>
wrote:
I am trying to install Smarty using PHP 5 on a Windows XP PC using IIS
v6

<?php
require('Smarty.class.php');
$smarty = new Smarty;

$smarty->template_dir = '/Program
Files/PhpIncludes/Smarty-2.6.9/demo/templates';
Using directory names with spaces in is a recipe for pain and annoyance, if
not outright disaster. I'd recommend moving everything into a directory without
spaces in it.

Might not be the cause of your problem but you'll likely avoid headaches
later.
$smarty->compile_dir = '/Program
Files/PhpIncludes/Smarty-2.6.9/demo/templates_c';
$smarty->config_dir = '/Program
Files/PhpIncludes/Smarty-2.6.9/demo/configs/';
$smarty->cache_dir = '/Program Files/PhpIncludes/Smarty-2.6.9/demo/cache/';

Gives the following error:

Warning: Smarty::fetch(/Program
Files/PhpIncludes/Smarty-2.6.9/demo/templates_c\%%93^934^9348F8B7%%index2.tpl.php)
[function.fetch]: failed to open stream: No such file or directory in
C:\Program Files\PhpIncludes\Smarty-2.6.9\libs\Smarty.class.php on line 1251
OK, obvious question first, does the directory given exist?
Does the filename referenced exist?
Any Ideas please?


Next on the list is checking permissions, since Smarty needs to write to the
template_c directory - have permissions been loosened sufficiently? (If I
remember correctly, for IIS it's the IUSR_<machinename> account needs write
access to the directory). Same again for the cache directory, too.

--
Andy Hassall / <an**@andyh.co.uk> / <http://www.andyh.co.uk>
<http://www.andyhsoftware.co.uk/space> Space: disk usage analysis tool
Jul 17 '05 #2

P: n/a
M
Yep that di the trick!

Many Thanks.

Martin

"Andy Hassall" <an**@andyh.co.uk> wrote in message
news:l2********************************@4ax.com...
On Tue, 28 Jun 2005 18:54:48 GMT, "M"
<ih*****************@spamgourmet.com>
wrote:
I am trying to install Smarty using PHP 5 on a Windows XP PC using IIS
v6

<?php
require('Smarty.class.php');
$smarty = new Smarty;

$smarty->template_dir = '/Program
Files/PhpIncludes/Smarty-2.6.9/demo/templates';


Using directory names with spaces in is a recipe for pain and annoyance,
if
not outright disaster. I'd recommend moving everything into a directory
without
spaces in it.

Might not be the cause of your problem but you'll likely avoid headaches
later.
$smarty->compile_dir = '/Program
Files/PhpIncludes/Smarty-2.6.9/demo/templates_c';
$smarty->config_dir = '/Program
Files/PhpIncludes/Smarty-2.6.9/demo/configs/';
$smarty->cache_dir = '/Program
Files/PhpIncludes/Smarty-2.6.9/demo/cache/';

Gives the following error:

Warning: Smarty::fetch(/Program
Files/PhpIncludes/Smarty-2.6.9/demo/templates_c\%%93^934^9348F8B7%%index2.tpl.php)
[function.fetch]: failed to open stream: No such file or directory in
C:\Program Files\PhpIncludes\Smarty-2.6.9\libs\Smarty.class.php on line
1251


OK, obvious question first, does the directory given exist?
Does the filename referenced exist?
Any Ideas please?


Next on the list is checking permissions, since Smarty needs to write to
the
template_c directory - have permissions been loosened sufficiently? (If I
remember correctly, for IIS it's the IUSR_<machinename> account needs
write
access to the directory). Same again for the cache directory, too.

--
Andy Hassall / <an**@andyh.co.uk> / <http://www.andyh.co.uk>
<http://www.andyhsoftware.co.uk/space> Space: disk usage analysis tool

Jul 17 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.