I am using Dev C++ for programming, and I can create a new file, but not a project. If I try to create a project then this error occurs:
Could not change to the Templates Directory()..»
How can I fix this problem?
asked Mar 26, 2016 at 13:18
A problem like this sometimes is solved in the easiest way by just not solving it at all. Try to update Dev-C++ and then restart it and see if that works. If it doesn’t, then uninstall it and download it directly from Blookshed.net or SourceForge, then reinstall it.
answered Mar 26, 2016 at 14:27
6 / 10 / 2 Регистрация: 29.05.2015 Сообщений: 661 |
|
1 |
|
01.09.2015, 18:08. Показов 2675. Ответов 5
Could not change to the templates directory….. — ошибка. На ноуте с виндой 7 всё нормально,на 8 — я уже написал. В чём причина?
0 |
174 / 170 / 19 Регистрация: 31.08.2010 Сообщений: 573 |
|
02.09.2015, 19:44 |
2 |
а какой компилятор?
0 |
Супер-модератор 6146 / 2889 / 1299 Регистрация: 04.03.2013 Сообщений: 5,751 Записей в блоге: 1 |
|
02.09.2015, 20:31 |
3 |
TheAthlete, ну так поди стандартный minGW ж поставляется с DevC++
0 |
6 / 10 / 2 Регистрация: 29.05.2015 Сообщений: 661 |
|
04.09.2015, 14:17 [ТС] |
4 |
TheAthlete, проект создать не могу. Добавлено через 58 секунд
0 |
20 / 20 / 23 Регистрация: 05.06.2011 Сообщений: 119 |
|
06.09.2015, 03:59 |
5 |
Директория с темплейтами присутствует?
0 |
6 / 10 / 2 Регистрация: 29.05.2015 Сообщений: 661 |
|
11.09.2015, 11:50 [ТС] |
6 |
matepuhko, не знаю.
0 |
Hey there, I’m having troubles creating a project.
When I go to file > new > project > I get the error message:
Error
Could not change to the Templates directory
(C:UsersOniDesktopTemplates)…
OK
and if I click OK, I get the new project screen but it is blank.
I tried uninstalling Dev-C++ and installing it again, that allowed me to
create a project ONCE. If at any time I closed the project, even without
saving, I’d get the template directory error again.
I’d love to get this fixed ASAP, any and all help is greatly appreciated!
Oni
Here’s my code:
Sub AttachTemplate()
Dim appWord As Application, TemplateDir As String, Loc As String
Set appWord = GetObject(, «Word.Application»)
TemplateDir = appWord.Options.DefaultFilePath(wdUserTemplatesPath) & «»
Loc = TemplateDir & «poms2012.dotm»
With ActiveDocument
.UpdateStylesOnOpen = True
.AttachedTemplate = Loc
.XMLSchemaReferences.AutomaticValidation = True
.XMLSchemaReferences.AllowSaveAsXMLWithoutValidation = False
End With
End Sub
I removed extraneous stuff so you could see the logic. It dies at .AttachedTemplate = Loc. I have tried removing the folllowing two lines, hardcoding the value of Loc, putting in error checking, nothing works.
Background: I have several macros kicking off upon document_open. There is an embedded template in the document that is first placed in the templates folder. I have a checker to see if the file is open and waits for it to close (this was removed
for simplicity). After reassigning the new template, it fixes the styles with another macro and opens the styles window. These work fine if I remove the macro that attaches the template.
Please help. I had it working for a day or so a few months ago. I came in to work the next day and it failed. I have no idea what happened. I need it to work in both 2010 and 2007. Thank you!
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and
privacy statement. We’ll occasionally send you account related emails.
Already on GitHub?
Sign in
to your account
Closed
schel4ok opened this issue
Jan 4, 2019
· 19 comments
Comments
I cannot install postfixadmin
Setup.php gives me following info
Postfix Admin Setup Checker
Running software:
PHP version 7.0.33-0+deb9u1
Apache/2.4.25 (Debian)
Checking for dependencies:
Magic Quotes: Disabled - OK
Depends on: presence config.inc.php - OK
Checking $CONF['configured'] - OK
Error: Smarty template compile directory templates_c is not writable.
Please make it writable.
If you are using SELinux or AppArmor, you might need to adjust their setup to allow write access.
Depends on: MySQL 4.1 - OK
Testing database connection - OK - mysqli://postfixadmin:xxxxx@localhost/postfixadmin
Depends on: session - OK
Depends on: pcre - OK
Depends on: multibyte string - OK
Depends on: IMAP functions - OK
Please fix the errors listed above.
Then I tried to do actions described in https://github.com/postfixadmin/postfixadmin/blob/master/INSTALL.TXT
root@mail:~# mkdir -p /srv/postfixadmin/templates_c
root@mail:~# chown -R www-data /srv/postfixadmin/templates_c
But nothing changed. I have same error anyway.
My system is Debian GNU/Linux 9.6 (stretch)
10.1.37-MariaDB
PHP version 7.0.33-0+deb9u1
Apache/2.4.25 (Debian)
Hmm…. can you look at your version of setup and see where it’s expecting the templates_c directory to be?
What do you mean under «version of setup»?
I also want to know where it’s expecting the templates_c directory to be.
I did installation like that
apt-get install -y postfix postfixadmin
root@mail:~# apt-cache policy postfixadmin
postfixadmin:
Installed: 3.0.2-2
Candidate: 3.0.2-2
Version table:
*** 3.0.2-2 500
500 http://ftp.ru.debian.org/debian stretch/main amd64 Packages
100 /var/lib/dpkg/status
Directories not existed after apt-get install -y postfix postfixadmin
I created them myself with following command
root@mail:~# mkdir -p /srv/postfixadmin/templates_c
root@mail:~# chown -R www-data /srv/postfixadmin/templates_c
So root was owner of them.
Now I changed ownership chown -R www-data:www-data /srv/postfixadmin
CHMOD 0755 on postfixadmin and subdirectories
srv owner is root, but CHMOD is 755, so I believe apache can read that directory
so I should do like that?
apt-get remove postfixadmin
cd /srv/
wget -O postfixadmin.tgz https://github.com/postfixadmin/postfixadmin/archive/postfixadmin-3.2.tar.gz
tar -zxvf postfixadmin.tgz
mv postfixadmin-postfixadmin-3.2 postfixadmin
Yes that solved my problem.
It works now.
So please put update to INSTALL.TXT to avoid installation using DEB package
Hmm; I think something else is going on there — e.g. the .deb package is trying to use some other directory — e.g. /var/lib/postfixadmin/templates_c or something like that ….
The .deb SHOULD work …. (obviously!)
Your permissions/ownership on /srv, and /srv/postfixadmin were fine. /srv/postfixadmin/templates_c should be owned by www-data — assuming that’s your web server using (if using Apache). Otherwise, I’m not sure what’s going on. I have a vague memory of official Debian packages using /var/lib/postfixadmin/templates_c or something.
It’s a bit hard to know more without either you editing lib/smarty.inc.php and var_dumping the realpath($template_c) dir … or checking /var/log/apache2/error.log
I didn’t edit lib/smarty.inc.php
and as you saw by default from deb package I had postfix 3.0.2-2, not 3.2
@schel4ok: Which Debian release are you using?
it is written in the first message My system is Debian GNU/Linux 9.6 (stretch)
root@mail:~# uname -a
Linux mail.iserver.ru 4.9.0-8-amd64 #1 SMP Debian 4.9.130-2 (2018-10-27) x86_64 GNU/Linux
root@mail:~# lsb_release -a
No LSB modules are available.
Distributor ID: Debian
Description: Debian GNU/Linux 9.6 (stretch)
Release: 9.6
Codename: stretch
root@mail:~# apt-cache show postfixadmin
Package: postfixadmin
Version: 3.0.2-2
Installed-Size: 3675
Maintainer: Norman Messtorff <normes@normes.org>
Architecture: all
On 05.01.19 20:49, schel4ok wrote:
***@***.***:~# uname -a Linux mail.iserver.ru 4.9.0-8-amd64 #1 SMP
Debian 4.9.130-2 (2018-10-27) x86_64 GNU/Linux ***@***.***:~#
lsb_release -a No LSB modules are available. Distributor ID: Debian
Description: Debian GNU/Linux 9.6 (stretch) Release: 9.6 Codename:
stretch ***@***.***:~# apt-cache show postfixadmin Package: postfixadmin
Version: 3.0.2-2 Installed-Size: 3675 Maintainer: Norman Messtorff
***@***.***> Architecture: all |
Have you tried:
http://ftp.debian.org/debian/pool/main/p/postfixadmin/postfixadmin_3.2-4_all.deb
It is as of last September, but that is at least 1.5 years better/newer
then the package you have installed currently.
@david:
This is a perfect example of what we’ve discussed earlier. A release
would be great so that I can push for an update of the Debian package.
Yes…… I discussed creating a new release briefly with @cboltz a few days ago on IRC.
I believe he’s going to test a few things.
I’m toying with the idea of migrating the codebase to PDO (which would give us prepared statements).
I’m also not terribly happy with some of the password expiration stuff — I think it possibly needs to change so we have a password_updated timestamp column or we have a better mechanism for hooks — as the existing code (e.g. around
if (Config::bool(‘password_expiration’)) { |
) is a bit fragile…
On 06.01.19 10:28, David Goodwin wrote:
Yes…… I discussed creating a new release briefly with @cboltz
<https://github.com/cboltz> a few days ago on IRC.
I believe he’s going to test a few things.
Great!
I’m toying with the idea of migrating the codebase to PDO (which would
give us prepared statements).
You’re talking about PHP Data Objects? http://php.net/manual/de/book.pdo.php
Interesting idea, but that will take some time to implement and test I
belive and should be something for release+1 if we want to have a chance
to get the current code into the next Debian release.
I agree.
Cheers
Mike
Hi, I know that the post is old, but in mi case I resolved the error
Error: Smarty template compile directory templates_c is not writable.
Please make it writable.
If you are using SELinux or AppArmor, you might need to adjust their setup to allow write access.
changed the owner to directory: /usr/share/postfixadmin/templates_c/
sudo chown www-data templates_c/ -R
Regards.
Dario.