View previous topic :: View next topic |
Author |
Message |
boots Administrator
Joined: 16 Apr 2003 Posts: 5611 Location: Toronto, Canada
|
Posted: Fri Dec 05, 2003 2:58 am Post subject: Smarty Error: the $compile_dir '..' does not exist... |
|
|
For people having this problem, try this (corrections/additions welcome):
Is safe_mode in effect? (can be set in php.ini, httpd.conf, .htaccess)
NO
- path to templates_c (and/or cache) must be read-writable by webserver process UID
YES
- ensure $smarty->use_sub_dirs = false;
- script owner UID and templates_c (and/or cache) owner UID must match -- this can be relaxed to GID matching by setting the php ini safe_mode_gid = On
- you can verify that this is setup properly: create a php script to write a file into the directory you specified for templates_c (and/or cache). This should always work if the directory is writable by the script owner. The trick is to then try to read that file from your php script -- safe mode restricts reads, not writes. If that throws an error, you have a permission settings issue.
- safe_mode is not necessary in a single user environment (IMO); however you may not have control of this in your environment
Note, if you are using open_basedir then template_c (and/or cache) must exist in a path reachable with that setting.
HTH |
|
Back to top |
|
gaurav_sting Smarty Rookie
Joined: 11 Mar 2004 Posts: 7
|
Posted: Thu Apr 08, 2004 4:09 am Post subject: problem solved |
|
|
thanx alot, the problem is solved.
Gaurav Behl |
|
Back to top |
|
Josiah Smarty n00b
Joined: 15 Jun 2004 Posts: 3 Location: Michigan
|
Posted: Tue Jun 15, 2004 1:27 pm Post subject: |
|
|
Quote: | NO
- path to templates_c (and/or cache) must be read-writable by webserver process UID |
Does this mean that those sub-directories must be CHMODed to readable/writable? Because I did that, and it still doesn't work. _________________ My Current Project |
|
Back to top |
|
Josiah Smarty n00b
Joined: 15 Jun 2004 Posts: 3 Location: Michigan
|
Posted: Tue Jun 15, 2004 1:29 pm Post subject: |
|
|
Quote: | must be read-writable by webserver process UID |
What is "webserver process UID"? _________________ My Current Project |
|
Back to top |
|
Josiah Smarty n00b
Joined: 15 Jun 2004 Posts: 3 Location: Michigan
|
Posted: Tue Jun 15, 2004 2:25 pm Post subject: |
|
|
Sorry, I was putting the sub-directories in the wrong place. They needed to go in the same directory that I was running the Smarty script in. Everything is working now. _________________ My Current Project |
|
Back to top |
|
sea_project Smarty Rookie
Joined: 22 Jan 2005 Posts: 6
|
Posted: Sat Jan 22, 2005 11:53 pm Post subject: |
|
|
My phpinfo() is:
Quote: |
safe_mode Off Off
safe_mode_exec_dir / /
safe_mode_gid On On
safe_mode_include_dir /usr/local/lib/php /usr/local/lib/php
|
'templaces_c' and 'cache' dirs are ok, and I wrote a script that creates a file in those dirs to test permissions.
But I continue getting that error:
Quote: |
WARNING [/home/chs/server/home/data/smarty/Smarty.class.php:1088] Smarty error: the $compile_dir 'templates_c' does not exist, or is not a directory.
|
Could you help me? |
|
Back to top |
|
miahawk Smarty n00b
Joined: 09 Apr 2005 Posts: 1
|
Posted: Sat Apr 09, 2005 5:08 am Post subject: Did you ever resolve the error on line 1088? |
|
|
I'm getting the same error. So far I've managed to work through everything I've encountered, but chmodding didn't do anything for me at this point and I'm just trying to get the smarty_unit_test to run.
Thanks! |
|
Back to top |
|
cvb Smarty n00b
Joined: 29 Jun 2005 Posts: 3
|
Posted: Wed Jun 29, 2005 7:45 pm Post subject: Re: Smarty Error: the $compile_dir '..' does not exist... |
|
|
boots wrote: |
- you can verify that this is setup properly: create a php script to write a file into the directory you specified for templates_c (and/or cache). This should always work if the directory is writable by the script owner. The trick is to then try to read that file from your php script -- safe mode restricts reads, not writes. If that throws an error, you have a permission settings issue.
|
This is what seems to be happening to me. I'm using windows with apache/php/mysql. I've had no real issues getting smarty going on linux and mac os x, however, we're pulling our hair out. It should be noted that we aren't windows people, but have opened up permissions on the directories.
The copiled file is being written to templates_c, however we recieve this error when trying to read it.
Warning: Smarty::fetch(templates_c\%%6D^6D7^6D7C5625%%test.tpl.php) [function.fetch]: failed to open stream: No such file or directory in C:\php\PEAR\smarty\Smarty.class.php on line 1251
Warning: Smarty::fetch() [function.include]: Failed opening 'templates_c\%%6D^6D7^6D7C5625%%test.tpl.php' for inclusion (include_path='c:\php\PEAR\') in C:\php\PEAR\smarty\Smarty.class.php on line 1251
Are there any people who have faced this? I know it has to be a permissions issue. We have exhausted ourselfs in security panes, and opened up everything. Why can't we make it work?
What really fries my noodle is that it can read the file in templates dir, and write the file to templates_c dir, but then can't read the file in templates_c. WTH!
Last edited by cvb on Wed Jun 29, 2005 8:22 pm; edited 1 time in total |
|
Back to top |
|
mohrt Administrator
Joined: 16 Apr 2003 Posts: 7368 Location: Lincoln Nebraska, USA
|
|
Back to top |
|
cvb Smarty n00b
Joined: 29 Jun 2005 Posts: 3
|
Posted: Wed Jun 29, 2005 8:24 pm Post subject: |
|
|
I must be the only person using Apache/Windows. Anyone else get this combo running? |
|
Back to top |
|
mohrt Administrator
Joined: 16 Apr 2003 Posts: 7368 Location: Lincoln Nebraska, USA
|
Posted: Wed Jun 29, 2005 8:28 pm Post subject: |
|
|
Search the forum for "windows permissions" or "IIS permissions" (be sure to choose the search for all terms), see if you find what you're after. Also check the wiki. |
|
Back to top |
|
boots Administrator
Joined: 16 Apr 2003 Posts: 5611 Location: Toronto, Canada
|
Posted: Wed Jun 29, 2005 8:51 pm Post subject: |
|
|
I run Apache/Windows on some setups.
Your problem is permissions, notably the apache user must have read and write permissions on the templates_c directory as well as the files in it.
i - clear out all the files in templates_c
ii - ensure proper permissions for the user that the apache server is running as such that it has r/w on templates_c
iii - restart your apache server (or clear the filestatcache)
Another thing (this may be important if you are running across multiple drives/devices): use absolute paths instead of relative paths to define the templates, templates_c, cache and other Smarty related directories. |
|
Back to top |
|
speedieB Smarty n00b
Joined: 03 Jul 2005 Posts: 2
|
Posted: Sun Jul 03, 2005 3:36 pm Post subject: |
|
|
seen this post .......
http://www.phpinsider.com/smarty-forum/viewtopic.php?t=5627 stating that smarty can be installed locally on a shared webhosting server
been following the Codewalkers - Smarty for beginners tutorial..........
http://codewalkers.com/tutorials/56/1.html,
uploaded all the relevant files[content of smarty/libs] to my hosting company's server(apache1.3.33) got all directory structures correct in my libs.ini file but am getting a
Fatal error: Smarty error: unable to write to $compile_dir '/home/username/public_html/smartyrules/compile'. Be sure $compile_dir is writable by the web server user.
error message returned.
hosting co's apache has safe_mode =off
so I have put $smarty->use_sub_dirs=false; into my libs.ini file but still not getting any joy.
Please shed some light wise ones.......... |
|
Back to top |
|
boots Administrator
Joined: 16 Apr 2003 Posts: 5611 Location: Toronto, Canada
|
Posted: Sun Jul 03, 2005 11:24 pm Post subject: |
|
|
@speedieB: after you uploaded all the relevant files, did you create the appropriate work directories for Smarty? Did you grant them appropriate permissions so that the webserver can read/write them? One method of doing so is to cause them to be created from a PHP script instead of your FTP client, though both should work as long as you get the permissioning correct. |
|
Back to top |
|
cvb Smarty n00b
Joined: 29 Jun 2005 Posts: 3
|
Posted: Mon Jul 04, 2005 3:03 am Post subject: |
|
|
boots wrote: |
ii - ensure proper permissions for the user that the apache server is running
|
Ok, what user is apache using by default? Was won created during apache install? |
|
Back to top |
|
|