When saving a template I'm greeted with this rather familiar error:

Unable to save your template as a text file

It's definitely the server path, since the permissions of the templates folder are set to 777.

The server path I'm working with looks rather peculiar though. When printing the $_SERVER["SCRIPT_FILENAME"], I get this in return:


notice the backslashes, instead of forward slashes.

So, I'm using this for my Basepath to Template File Directory, but apparently I'm still doing something wrong.


Any ideas ?

  • Do you use a config.php file or just the DB at this point? Mar 16, 2013 at 8:10
  • @JérômeCoupé how do you mean ? I've set my basepath in the global template preferences in the backend. My db and config are both up and running, but I don't understand what they have to do with this ?
    – janvl
    Mar 16, 2013 at 14:44
  • Yikes, Windows, I try to avoid it. Also it's bad to use 777 (btw, there's no such permissions on a Windows server). Have you tried this guide: iis.net/learn/application-frameworks/…
    – Paul
    Mar 16, 2013 at 19:53

2 Answers 2


There are only two reasons templates won't save as flat files:

  1. The permissions on the destination directory are not set to 777

  2. The path to the directory is not correct.

In your case, the path is not correct. Changing the path from:




without the trailing slash, will fix the issue.

DOCS: Set Template Preferences

  • it'll most likely be the permissions. You can't set the permissions on IIS like you can with Apache. You may need to get the host to do this directly. Mar 18, 2013 at 8:04

In the root of your site, i.e the same level as the index.php, create a file called info.php and put in there the following code:




Then using your browser, go to yoursite.com/info.php (obviously replace yoursite.com with whatever your url is for accessing your site) and put here whatever it outputs. Then, delete that file!

Or, whatever it outputs, just add the rest of the template folders file path onto the end using the same slash direction that it outputs.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.