Hi Guys,
This one has really got me stumped - I have tried for about a week now using various different sites for advice all to no avail.
I am trying to load (and run) Smarty on xampp. I have followed all the advice given but when I run https://localhost/index_1.php I get the following:
Warning: require(Smarty.class.php) [function.require]: failed to open stream: No such file or directory in C:\xampp\htdocs\index_1.php on line 13
Fatal error: require() [function.require]: Failed opening required 'Smarty.class.php' (include_path='.;C:\xampp\php\pear";.') in C:\xampp\htdocs\index_1.php on line 13
To explain what has happened so far:
1. Loaded Smarty as follows -
c:/xampp/smarty/cache
/demo
/libs
/templates_c
2. Loaded c:/xampp/htdocs/smarty/configs
/templates
3. Having checked the PHPInfo that this is the correct file I have edited c:/xampp/php/php.ini 'paths & Directories' -
include_path = ".;C:\xampp\php\pear\";".;C:\xampp\smarty\libs\"
4. Created c:/xampp/htdocs/index_1.php with the following code -
<?php
// load Smarty library
require('Smarty.class.php');
$smarty = new Smarty;
$smarty->template_dir = 'C:/xampp/htdocs/smarty/templates';
$smarty->config_dir = 'C:/xampp/htdocs/smarty/configs';
$smarty->cache_dir = 'C:/xampp/smarty/cache';
$smarty->compile_dir = 'C:/xampp/smarty/templates_c';
$smarty->assign('name','badBadger!');
$smarty->display('index_1.tpl');
?>
5. Created c:/xampp/htdocs/smarty/templates/index_1.tpl with the following code -
<body>
Hello, {$name}!
</body>
As I say, I have tried changing most of the parameters without any success and it is just about driving me round the bend. If anyone can see where I have gone wrong I would be very grateful.
In hope,
'H'