Smarty Forum Index Smarty
WARNING: All discussion is moving to https://reddit.com/r/smarty, please go there! This forum will be closing soon.

Problem with compile templates

 
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    Smarty Forum Index -> General
View previous topic :: View next topic  
Author Message
arkadiusz
Smarty n00b


Joined: 27 Jul 2008
Posts: 3

PostPosted: Sun Jul 27, 2008 10:26 pm    Post subject: Problem with compile templates Reply with quote

Hello,

I have problem with smarty. I'm trying fix it almost 2 days... I'm really close to give up...

My problem:

[All director got full privilages!! Smarty creates wrt(...).tmp files in templates_c]
Quote:

Warning: Smarty::include(./plugins/smarty/templates_c\%%90^902^9024AEA4%%MyPage.tpl.php) [smarty.include]: failed to open stream: No such file or directory in ...


Allways when i run my page, smarty creates another WRT(...).TMP file in templates_c and stop working. I really dont understand, why smarty dont compile and rename it.

Any solutions?
Back to top
View user's profile Send private message
mohrt
Administrator


Joined: 16 Apr 2003
Posts: 7368
Location: Lincoln Nebraska, USA

PostPosted: Mon Jul 28, 2008 1:53 am    Post subject: Reply with quote

You might try here:

http://www.phpinsider.com/smarty-forum/viewtopic.php?t=4500
Back to top
View user's profile Send private message Visit poster's website
arkadiusz
Smarty n00b


Joined: 27 Jul 2008
Posts: 3

PostPosted: Mon Jul 28, 2008 7:03 pm    Post subject: Reply with quote

Thank You for that link. I used this script. I still don't know, what is wrong.
Mayby someone got some ideas. I really need help Smile

Quote:

testing start:
template_dir is 'templates'
real system path: C:\Inetpub\wwwroot\aaa\templates
file perms: 0777
OK.
config_dir is './plugins/smarty/configs'
real system path: C:\Inetpub\wwwroot\aaa\plugins\smarty\configs
file perms: 0777
OK.
plugins_dir (0) is 'plugins'
real system path: C:\Inetpub\wwwroot\aaa\plugins
file perms: 0777
OK.
compile_dir is './plugins/smarty/templates_c2'
real system path: C:\Inetpub\wwwroot\aaa\plugins\smarty\templates_c2
file perms: 0777

Warning: unlink(./plugins/smarty/templates_c2/test_file) [function.unlink]: Permission denied in C:\Inetpub\wwwroot\aaa\Smarty_test.php on line 66

OK.
cache_dir is 'plugins/smarty/cache'
real system path: C:\Inetpub\wwwroot\aaa\plugins\smarty\cache
file perms: 0777

Warning: unlink(plugins/smarty/cache/test_file) [function.unlink]: Permission denied in C:\Inetpub\wwwroot\aaa\Smarty_test.php on line 92
OK.
testing complete.


PS. I'm using virutal machine with windows 2k3 and iis.
Back to top
View user's profile Send private message
mohrt
Administrator


Joined: 16 Apr 2003
Posts: 7368
Location: Lincoln Nebraska, USA

PostPosted: Mon Jul 28, 2008 8:12 pm    Post subject: Reply with quote

It was unable to delete the test file placed in the compile_dir or cache_dir. That may be part of the problem. Try a simple test PHP script that creates a file and deletes it, see if you can get that to work?

I'm guessing your PHP setup is not allowing the unlinking (deletion) of files it creates.
Back to top
View user's profile Send private message Visit poster's website
mohrt
Administrator


Joined: 16 Apr 2003
Posts: 7368
Location: Lincoln Nebraska, USA

PostPosted: Mon Jul 28, 2008 8:17 pm    Post subject: Reply with quote

I see you are on Windows. You might try right-clicking the compile_dir/cache_dir and check the properties. Make sure permission are set so the apache/php process can remove files.
Back to top
View user's profile Send private message Visit poster's website
arkadiusz
Smarty n00b


Joined: 27 Jul 2008
Posts: 3

PostPosted: Mon Jul 28, 2008 8:30 pm    Post subject: Reply with quote

FIXED!

My steps:
I removed all rights from inetpub and wwwroot director
I deleted wwwroot;
I created wwwroot directory again;
Give all rights again;
Copy my project to wwwroot;

Start IIS

All work fine Very Happy


Thanks Mohrt for Your help and time. You really help me with this script Smile
Back to top
View user's profile Send private message
tathode
Smarty n00b


Joined: 26 Oct 2009
Posts: 1

PostPosted: Mon Oct 26, 2009 2:28 pm    Post subject: Reply with quote

for me it worked when i gave full permission to template_c folder, just giving read write permission it wont work

-- Tathode
Back to top
View user's profile Send private message
somefork
Smarty n00b


Joined: 25 Nov 2010
Posts: 1

PostPosted: Thu Nov 25, 2010 9:55 pm    Post subject: Reply with quote

Hello. My English is bad, but i need help.
I have got this problem. I do not know, how give all rights to folder.

My system:
Windows 7, and "denwer"(denwer.ru - apache+php+perl+mysql with small size)

Please help me.
Back to top
View user's profile Send private message
nedo
Smarty Rookie


Joined: 30 Mar 2012
Posts: 8

PostPosted: Sat Mar 31, 2012 6:40 am    Post subject: Reply with quote

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 Confused ,
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
View user's profile Send private message Send e-mail
U.Tews
Administrator


Joined: 22 Nov 2006
Posts: 5068
Location: Hamburg / Germany

PostPosted: Sat Mar 31, 2012 7:05 am    Post subject: Reply with quote

Please post our problems just in on place in the forum.....
Back to top
View user's profile Send private message
marchyang
Smarty n00b


Joined: 21 Jan 2014
Posts: 3

PostPosted: Wed Jan 22, 2014 4:49 am    Post subject: Doesn't work for me !! Reply with quote

I tried to make full control to IIS_IUSRS for wwwroot and demo which is test for smarty and then restart IIS, and browsing http://localhost/demo/index.php but the same error message displayed.
So I can't understand what's the meaning of making full control right to wwwroot for whom ?
As my knowledgement, Windows Server 2012 with IIS installed, not Apache, the default service account for IIS is set to IIS_IUSRS, and the owner for inetpub is Administrators, and no PHP releated account created when PHP & Smarty installed, so to whom with full control right ?
Any idea is appreciated !!
Back to top
View user's profile Send private message
Display posts from previous:   
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    Smarty Forum Index -> General All times are GMT
Page 1 of 1

 
Jump to:  
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
Protected by Anti-Spam ACP