• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 241
  • Last Modified:



I have used smarty both on LINUX hosting and my own WINDOWS PC.
There is no problems with that.

But I have problems when I use it on WINDOWS hosting.

I have no idea how to fixed it, I search on google, and has browse
this forum with no luck.

Here is my situation :
1. I think I set all permision to templates_c and cache correctly
2. When page is display, I can see that SMARTY is able to write to
my templates_c directory,
but SMARTY can't read or write to those files.
I got warning PERMISION DENIED, and
nothing is display - just a blank page.

3. Also I notice that on my templates_c folder, besides
%%1A^1AB^1AB9BADF%%XXXXX.html.php file also
and SMARTY keep adding new XXXX.tmp file everytime display function is called.

Since I am only user, and has no capability to change the server environtment, what else can I do to make it works?

Thanks in advance for your kind help.
The database connection is ok. When I print array values it prints correctly.

  • 2
1 Solution
Well the user that the web server runs as need to have full access to the templaces_c and cache directories.  That user may be something strange in a shared hosting environment.  Do you know for sure which user it is (in a dedicated it would probably be either apache or nobody)?  Can you check the permissions again on those directories and post them?

Where do you see the permission denied message, on the screen on in the log?  Check the apache error log for errors if you haven't - there may be more useful information there.  Can you post the last few lines?

I'd tell you to make sure that your paths have changed from a windows format to unix format but I think you'd be getting "not found" messages instead of "access denied" if that was the case - but worth double-checking, it may be trying to write somewhere you aren't expecting.
Desire2changeAuthor Commented:
I have changed the permission thru ftp to 777 for cache and templates_c folders
Also i checked all the folder paths all are ok.
No error messages are displaying.
the structure comes, it is multilingual so I use a function 'getlabel' which fetches labels from the db, the labels are also displaying, but other records are not displaying.

For example:
$trs=$this->db->query("select * from tblsubleftmenu where fldcid=".$fldid." and fldlangid=".$_SESSION['FldLanguageId']);
If I say print_r($trsrow), it displays the record
but I think
is not working........

You are probably running windows on NTFS partitions which enable extended protection.
I think you need to use Windows explorer to go to your directorise (cache and template_c), then to change properties for these directories: make them "everything enabled" for all users.
That should imprive significantly your situation!

1 - Where do you stand on the issue?

2 - Looking back at the ill-functioning code
a -$ttrsrow=$trs->fetchRow();
b - extract($trsrow);
c - echo "this works"; print_r($trsrow);
d -            $this->smarty->assign("left",$$trsrow);
I have some slight questions which may simply result from pasting errors here:
line a: I presume this is $trsrow= (as in line b and c)
line d: your code here says '$$trsrow', which probably does not work

Other possible problem: are you sure that $this->smarty is correctly predefined? Depending on the code, not sure what exactly is covered by $this-> and maybe $this->smarty is not what expected

Assuming this is correct, you should check on how in your TPL template, you use the array 'left'?
I suggest that after this line d, or just before the call to smarty->display, you add the line

$smarty->debugging = true;
when you will call the "normal" smarty display, it will also pop-up a javascript windows which displays ALL the content of smarty variables (whether they are used or not in your template)

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now