View previous topic :: View next topic |
Author |
Message |
arkadiusz Smarty n00b
Joined: 27 Jul 2008 Posts: 3
|
Posted: Sun Jul 27, 2008 10:26 pm Post subject: Problem with compile templates |
|
|
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 |
|
mohrt Administrator
Joined: 16 Apr 2003 Posts: 7368 Location: Lincoln Nebraska, USA
|
|
Back to top |
|
arkadiusz Smarty n00b
Joined: 27 Jul 2008 Posts: 3
|
Posted: Mon Jul 28, 2008 7:03 pm Post subject: |
|
|
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
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 |
|
mohrt Administrator
Joined: 16 Apr 2003 Posts: 7368 Location: Lincoln Nebraska, USA
|
Posted: Mon Jul 28, 2008 8:12 pm Post subject: |
|
|
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 |
|
mohrt Administrator
Joined: 16 Apr 2003 Posts: 7368 Location: Lincoln Nebraska, USA
|
Posted: Mon Jul 28, 2008 8:17 pm Post subject: |
|
|
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 |
|
arkadiusz Smarty n00b
Joined: 27 Jul 2008 Posts: 3
|
Posted: Mon Jul 28, 2008 8:30 pm Post subject: |
|
|
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
Thanks Mohrt for Your help and time. You really help me with this script
|
|
Back to top |
|
tathode Smarty n00b
Joined: 26 Oct 2009 Posts: 1
|
Posted: Mon Oct 26, 2009 2:28 pm Post subject: |
|
|
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 |
|
somefork Smarty n00b
Joined: 25 Nov 2010 Posts: 1
|
Posted: Thu Nov 25, 2010 9:55 pm Post subject: |
|
|
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 |
|
nedo Smarty Rookie
Joined: 30 Mar 2012 Posts: 8
|
Posted: Sat Mar 31, 2012 6:40 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 |
|
U.Tews Administrator
Joined: 22 Nov 2006 Posts: 5068 Location: Hamburg / Germany
|
Posted: Sat Mar 31, 2012 7:05 am Post subject: |
|
|
Please post our problems just in on place in the forum..... |
|
Back to top |
|
marchyang Smarty n00b
Joined: 21 Jan 2014 Posts: 3
|
Posted: Wed Jan 22, 2014 4:49 am Post subject: Doesn't work for me !! |
|
|
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 |
|
|