Posted on 2007-10-02
Last Modified: 2013-12-13

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.

Question by:Desire2change
    LVL 14

    Expert Comment

    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.

    Author Comment

    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........

    LVL 29

    Accepted Solution

    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!
    LVL 29

    Expert Comment


    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

    Looking for New Ways to Advertise?

    Engage with tech pros in our community with native advertising, as a Vendor Expert, and more.

    Join & Write a Comment

    Foreword (May 2015) This web page has appeared at Google.  It's definitely worth considering! How to Know You are Making a Difference at EE In August, 2013, one …
    What is Node.js? Node.js is a server side scripting language much like PHP or ASP but is used to implement the complete package of HTTP webserver and application framework. The difference is that Node.js’s execution engine is asynchronous and event…
    This video teaches users how to migrate an existing Wordpress website to a new domain.
    Use Wufoo, an online form creation tool, to make powerful forms. Learn how to selectively show certain fields based on user input using rules to gather relevant information and data from your forms. The rules feature provides you with an opportunity…

    754 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    14 Experts available now in Live!

    Get 1:1 Help Now