2

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:

D:\WebSites\limited-cobe\www\test.php

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.

D:/WebSites/limited-cobe/www/system/expressionengine/templates/

Any ideas ?

3
  • Do you use a config.php file or just the DB at this point? – Jérôme Coupé Mar 16 '13 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 '13 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 '13 at 19:53
9

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:

D:/WebSites/limited-cobe/www/system/expressionengine/templates/

to:

D:/WebSites/limited-cobe/www/system/expressionengine/templates

without the trailing slash, will fix the issue.


DOCS: Set Template Preferences

1
  • 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. – Steven Grant Mar 18 '13 at 8:04
2

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:

<?php

echo $_SERVER['DOCUMENT_ROOT'];

?>

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, privacy policy and cookie policy

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