|
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 |
nbroers Smarty Rookie
Joined: 12 May 2005 Posts: 9
|
Posted: Thu Jun 23, 2005 9:47 am Post subject: Smarty warning: failed to create stream |
|
|
Hi all,
I have followed all avenues with this one and it still doesn't work
I have a site using Smarty which works fine on Apache. However, when I deploy to IIS 5.0 it fails.
Info:
IIS 5.0
PHP Version 4.3.1
safe_mode off
open_basedir (not set)
I uploaded a script to test read/write permissions and it prints the following:
templates_c is writeable
cache is writeable
templates_c is readable
cache is readable
templates is readable
When accessing the site, it prints the following:
Warning: fetch(C:\Inetpub\wwwroot\somesite\templates_c\\%%70^701^701205FA%%newslist_ad.tpl.php) [function.fetch]: failed to create stream: No such file or directory in C:\php\Smarty\libs\Smarty.class.php on line 1251
Warning: fetch() [function.fetch]: Failed opening 'C:\Inetpub\wwwroot\somesite\templates_c\\%%70^701^701205FA%%newslist_ad.tpl.php' for inclusion (include_path='.;c:\php4\pear') in C:\php\Smarty\libs\Smarty.class.php on line 1251
What am I doing wrong?? Any help appreciated!! |
|
Back to top |
|
nbroers Smarty Rookie
Joined: 12 May 2005 Posts: 9
|
Posted: Thu Jun 23, 2005 10:11 am Post subject: |
|
|
I apologise...
I guess errors like these are always due to incorrect permissions.
For future reference, this will help:
http://support.microsoft.com/default.aspx?scid=kb;en-us;Q271071
(IIS 5.0 ntfs permissions howto)
Problem was caused by some deny entry in advanced properties...
(right click templates_c folder in explorer -> security -> advanced -> Remove the "deny" listings to anonymous users) |
|
Back to top |
|
koejkje Smarty Rookie
Joined: 27 Nov 2003 Posts: 30 Location: Miami, Florida
|
Posted: Mon Mar 24, 2008 8:18 pm Post subject: |
|
|
What about Unix systems? I have the same problem 1000 times in my logs every day, I followed all instructions in the sticky FAQ and ran all test scripts and everything is exact using absolute paths. _________________ R. Stacy Cook
Edit-X :: Control Your Content
www.edit-x.com |
|
Back to top |
|
nedo Smarty Rookie
Joined: 30 Mar 2012 Posts: 8
|
Posted: Sat Mar 31, 2012 6:45 am Post subject: |
|
|
m facing the saem probelm but i dont knw how to fix it ..., where is problem m using dreamweaver and wamp server .., and for database pgmsql ...,
wamp server is in F derive .plz help me , m ,
cogfif.php
<?php
// SITE_ROOT contains the full path to the tshirtshop folder
//define('SITE_ROOT', dirname(dirname(__FILE__)));
define('SITE_ROOT', 'F:/wamp/www/hatshop');
//define('SITE_ROOT', 'http://localhost/hatshop/');
// Application directories
define('PRESENTATION_DIR', SITE_ROOT . '/presentation/');
define('BUSINESS_DIR', SITE_ROOT . '/business/');
// Settings needed to configure the Smarty template engine
define('SMARTY_DIR', SITE_ROOT . '/libs/smarty/');
define('TEMPLATE_DIR', PRESENTATION_DIR . 'templates');
define('COMPILE_DIR', PRESENTATION_DIR . 'templates_c');
define('CONFIG_DIR', SITE_ROOT . '/include/configs');
page.php
<?php
// Reference Smarty library
require_once SMARTY_DIR . 'Smarty.class.php';
/* Class that extends Smarty, used to process and display Smarty
files */
class Page extends Smarty
{
// Class constructor
public function __construct()
{
// Call Smarty's constructor
parent::Smarty();
// Change the default template directories
$this->template_dir = TEMPLATE_DIR;
$this->compile_dir = COMPILE_DIR;
$this->config_dir = CONFIG_DIR;
}
}
?>
applicationtopup.php
<?php
// Include utility files
require_once 'include/config.php';
// Load the page template
require_once PRESENTATION_DIR . 'page.php';
?>
index.php
<?php
// Load Smarty library and config files
require_once 'include/app_top.php';
// Load Smarty template file
$page = new Page();
// Display the page
$page->display('index.tpl');
// Load app_bottom which closes the database connection
require_once 'include/app_bottom.php';
?>
index.tpl
{* smarty *}
{config_load file="site.conf"}
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html>
<head>
<title>{#site_title#}</title>
<link href="hatshop.css" type="text/css" rel="stylesheet" />
</head>
<body>
<div>
<div class="left_box">
Place list of departments here
</div>
{include file="header.tpl"}
<div id="content">
Place contents here
</div>
</div>
</body>
</html>
and i hv deine cache dir is it must to creat this dir ..., and i have not change the perission of non of any 1 .., is i need to change the permssion on window platform .., m usind window 7 |
|
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
|